Hosting my Django site [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Hi I'm looking for some advice I currently own a resseller package with Heart internet as I host a few personal websites. However I'm currently learning Django (The python Framework) and want to be able to host my own server.
I have been setting up virtual servers to play around with. Anyway to have SSH access you have to send in and ask them to open it for you, in the meantime of asking them if it was possible to install Django / set up SSH access i was advised that i can't use Django unless i purchase a Virtual machine even though Python is intalled on the server.
Surley i can install Django onto my server if i have SSH access? Has anyone else has a similair issue? Or can anyone advise me on what to do.. The last thing i was to do is spend more money with them.
Thanks.

It sounds like you're describing a shared hosting situation where you have SSH access but the webserver is preconfigured for you. You cannot practically install and serve Django on that machine, because you will not have access to the Apache or other webserver configuration. You could theoretically serve Django from a port other than the typical HTTP port, but this would be extremely irregular and your hosting company would not appreciate it.
You can deploy Django on Heroku: https://devcenter.heroku.com/articles/django . It is free to deploy for extremely low-volume applications or for development; cost scales linearly with capacity above that.
You can also use Google App Engine with a slightly older version of Django. Either of these options have official support from the respective vendors and so they are much better ideas than trying to work around a restriction set by your hosting provider.
Finally, you could pay for a virtual machine, in which you would have full access to the webserver configuration and could serve anything you like. Virtual machines are available from any number of companies at a wide range of price points. You could also develop a Django application without hosting it anywhere but your local machine for starters, and worry about hosting after your application is functional.

AWS :
Free tier available
great support(but for technical help you got to pay)
can use platform (PAAS) BeanStalk
can customize architecture in case you get a dedicated instance
great community of support
Custom domain
great documentation
can SSH
Most popular
Heroku:(Django)
Free to some extent
Can use only POSTgresql in free plan
git must
Good support
easy to start
custom domain
Can use bash in production(Not SSH).. cannot make direct changes in production. This is what makes your App stable. Any change/update goes through git.
code maintenance - good (deployment through git heroku commands only)
use AWS S3 to store static files
Temporary files are removed perodically
Once you scale that they start to bill, it is really costly.
Since this is a PAAS, you have got what you have got. It takes lots of efforts to customize(to some extent) the architecture of the APP.
Google App Engine:( Flask/Django project.)
Free to some extent
very easy to start(hello world app)
custom domain
code maintenance - good (automatic deployment)
Support is not available
Pythonanywhere:
Free to some extent
No custom domain in free plan
easy to use
Good support
Webfaction:(Django)
Not free.. (I think (minimal plan) costs 10 $ per month on shared hosting. )
SSH available
custom domain
Architecture customization.
Good support

I have really good experiences with pythonanywhere.com. It's also free for really small projects.
For me it seems to be just perfect for experimenting with django. Here is a short story how I switched from Google App Engine to pythonanywhere.com: Django unchained - python in the cloud

I was doing the virtual server thing for a while - then entered Heroku. An extremely easy (and in some cases completely free) way to deploy my django application.
I started where you are,in a shared hosting environment trying to make django work. I then taught myself a lot of server admin and server setup things - thereby moving to a dedicated virtual server setup.
Alas making Django work with apache and on a Centos box can be a pain - But Heroku made it all better. Easy app deployment and scalability. Heroku is a cloud application deployment service - it's all the benefits of a virtual server without the setup. It doesn't actually install on your server
Check out these two articles
https://devcenter.heroku.com/articles/django
http://rdegges.com/devops-django-part-4-choosing-heroku (There are some more to this article but they are very lengthy)
I had a new django app up on the internet in half the time. There is lots of cost estimations involved, which is why I would dive deep into the second article and it's various parts.

You can host Django on Amazon EC2. If you take advantage of their free tier you can do so free for one year in a micro instance (618Mb RAM, 30Gb filesystem). You get full control of the machine, including SSH access. There are a number of freely available images that already bundle Django including the BitNami Django Amazon Machine Image which is also available for free (disclaimer: I am one of the BitNami developers)

Related

How to deploy Django without mod_wsgi

I'm relatively new to web development, but I have a couple years experience working with python, so I figured I would build my first production site using django.
I've spent the last few days learning the basics and building a test site running on my local machine. Today, I've been trying to deploy my site to production; however, I've hit a pretty large stumbling block.
The django documentation suggests using mod_wsgi for apache deployments. I followed the install instructions here, only to realize that I don't have access to make any changes to apache - I'm currently on a shared hosting plan.
Apparently, to perform the install, I would have to upgrade to a VPS plan, which costs a lot more.
Any advice for a new web developer trying to get a proof-of-concept web app together (preferably with feedback gathered from real users) on a budget?
I think I have two options:
Eat the cost on my current web hosting plan. Try to find a cheaper host that specializes in django hosting. I've been looking at the following (suggestions here would be wonderful):
Heroku
DigitalOcean
A2Hosting
Try some sort of manual deployment. Is this possible or has anybody ever made this work? I can't seem to find any resources about this.
I was able to install django on my web server and my site just seems like a collection of files at this point. Can I simply move this directory tree to my site using an ftp? And handle the database migration manually?
Can I just run django on my web server via ssh instead of from my local machine? Essentially just rebuild my site in production? I know this isn't a smart idea with a normal production site, but as a proof of concept, I don't mind some downtime if my code is buggy.
Thanks!
If you are just starting Heroku is probably perfect for you. It's super easy to set up, you don't have to handle the server configuration yourself and it has a free tier to do some tests until you are ready to go.
If you are OK with doing some more advanced server/service configuration, you can use Google Cloud, Azure or AWS. This last one has a one year free tier. If you go this route, I suggest using gunicorn/uwsgi + nginx instead of Apache mod_wsgi.

using dropbox as a server for my django app

I dont know if at all i make any sense, but this popped up in my mind. Can we use the 2gb free hosting of dropbox to put our django app over there and do some hacks to run our app?
No, it's not possible.
If you want to use dropbox as the hosting, you can put static pages, meaning just the html files with CSS and javascript because those files can be retrieved by doing a simple GET request.
Hosting a python code is not possible as it requires server side calculations & dropbox is just for saving files.
See the official wiki for the available hosts. https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts
The point you need to understand is: can you run django without djagno installed? Can django be installed on a usb-drive? Dropbox is but a cloud storage service NOT cloud hosting service. To store you do not require RAM and processors while for hosting you do.
Hence the answer is NO. If you are okay with configuring apache etc. you can go for VPS. If not try some managed servers. If you dont want to spend much and are looking at free hosting solutions for django a few of them are:
kodingen.com
shellmix.com
http://0x2a-dc.com/index.php?name=shop&cat=6
http://www.heliohost.org/home/
http://bitnami.org/cloud
https://www.alwaysdata.com/
more data:
http://freedjangohosting.com/
http://djangohosting.com/
https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts
Yes its possible! PythonAnywhere.com offers that!
What pythonanywhere does is pretty simple. They integrate your dropbox account with their one. When you want to create a Django app, all you got to do is, direct the platform to store the app in your dropbox folder!
Now, you can open your Django app in your PC and edit it (wait for some time to sync)..restart the app, it works! I practically tried.
Tip: There are many cloud platforms which offer great services for free. Openshift, Heroku, Google App Engine are to name a few!
No, you can't use DropBox to serve a Django Website, as doing so requires Python code to be run, when DropBox is only for saving & serving files.
You can, however, find free hosting for your Django needs, among which:
Heroku, originally meant for Ruby hosting, but now allows you to do Python hosting. I didn't find it particularly easy to use with Django though.
ep.io, Python-specific hosting, but invite-only for the moment - it's possible to get an invite by sending an email, explaining your project & your needs though. Offers you free SSL on *.ep.io, which is pretty nice, and they've got great service.
Dotcloud, not platform specific, but my personal favorite. It's pretty easy to get started, and the CLI allows you to do a lot (but the downside is that you need it a lot too). If you're not afraid of CLI, it's great.
Being said its not possible from dropbox to do that you can use very simple cloud hosting as told ahead,
I might be late for answer but you can get free cloud hosting from Linux Fedora company called RedHat. Their cloud product is available for free which supports django hosting. I tried it my own
Openshift Free Cloud Hosting
In addition to what Thomas posted, some other options for free django hosting:
Amazon Compute Instance (free for one year, free sign up).
Google App Engine (free limits,django howto).
OpenShift (django howto).

Deploying Django project on EC2 with BitNami image

I have a complex university project that requires building some specific libraries and the use of threads (AppEngine out of the question), and I want to deploy in on EC2 (Free tier deal).
I was wondering what would be best, to start with a bare linux distribution or the BitNami Django stack ?
I've seen similar questions here, but I'm looking for Pro's and Con's mainly.
The answer is pretty obvious. If you start with the Bitnami stack you'll save yourself the hassle of installing and configuring the various components (web server, gateway, python and the required libs, DB, etc.).
So if you app is pretty straight forward (typical web app) then sure, start with the bitnami stack. At most you'll reconfigure certain parts later on, as needed.
There's no particular joy in installing and configuring it all yourself, imo.

Getting started with Django on Amazon Web Services [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm starting to migrate a few applications to Amazon Web Services. My applications are Python/Django apps, running over MySQL.
I plan on using EC2 and EBS for starters.
I'm looking for a few things:
A good step-by-step tutorial explaining how to deploy Django on AWS. I've looked around, but most tutorials are from 2 years ago, so I'm worried they're outdated.
I'm trying to understand, with which AMI should I start? I know there's a BitNami AMI that comes preconfigured with Django goodiness, but I've seen a lot of other sources say you should start with a basic (clean) linux box and install everything yourself. Why?
Are there any other important things I should be thinking about? I have very little sysadmining experience (the apps are currently on WebFaction), so I'm not sure what I should be thinking about.
A few extra points:
I plan on running several applications on the same EC2 instance, I assume that's possible?
I'm using virtualenv to separate between the various apps right now, I assume I can continue doing the same on the EC2 instance?
Thanks!
There is nothing "special" with EC2 here. It just provides bare (or generally preconfigured from custom AMI) system instance - you have access to whole virtualized system, so you can safely break things on your own. Think about it as a specific VPS.
You have to prepare deployment by yourself, which is not so difficult - just follow the documentation. I'd advice to run with basic linux distro and add needed stuff than to rely on some preconfigured image. As for you questions:
You need to do two things: setup your instance (accounts, needed software, other custom setup, so some linux administration guide should be handy) and prepare django app deployment (deploy python code, hook up to web server). For the latter, general deployment instructions for django can be applied here ( http://docs.djangoproject.com/en/dev/howto/deployment/ ).
Start with AMI with your favorite linux distro, and then add necessary software from it's repository.
Mount and use EBS as soon as possible for all your data. When rebooted, EC2 instance will wipe out all it's data, so be prepared for this. Do system snapshots to AMI to have quick recovery on failure.
Yes, you can deploy several applications on one instance, but mind that EC2 instance is virtualized (with quite high "virtualization tax" imo, especially for smaller instances), so you might run into general performance problems. Assume that you'd need migrate to bigger instance/multiple instances after some time.
Virtualenv should be your default deployment tool. Yes, you can use it here too.
You can follow the official documentation of setting up Amazon ec2 instance: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-instance_linux.html
You should start with an AMI that you are familiar with. For example, if you use Ubuntu, you can just use one of the Ubuntu AMI in the recommended page. I didn't use the BitNami server and my Django site is deployed smoothly.
If you are using Apache server, just follow the instructions on the official Django doc:
https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/modwsgi/
I tried quite a few blogs but as you said, they are outdated. Just use the official docs and it will save you a lot of time.
This repo is meant to address exactly this issue - provide a reference implementation for a basic django project that can be deployed onto AWS ElasticBeanstalk.
https://github.com/pushkarparanjpe/django-awsome
It has:
Static assets
DB back-end
django contrib Admin
Just configure your EBS env, clone the repo and deploy!

Breaking out of the Google App Engine Python lock-in? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Are there any guidelines to writing Google App Engine Python code that would work without Google's infrastructure on other platforms?
Is there any known attempt to create an open source framework which can run applications designed for Google App Engine on other platforms?
Edit:
To clarify, the question really is:
If I develop an application on Google App Engine now, will I be able to migrate to another platform later, or is it a lock in?
There's a number of components required to make an app fully portable:
The runtime environment itself. This can be ported relatively simply, by setting up a CGI or FastCGI server that emulates the App Engine environment (which itself is basically slightly-enhanced CGI). Most of the code to do this is already in the SDK. Unfortunately, there's no easy pre-packaged toolkit for this yet.
The datastore. By far the most complicated API to port. There are a number of efforts underway: AppScale runs on EC2/Eucalyptus/Xen and uses a HyperTable or HBase backend; it's still very much beta quality and they don't distribute the data connector separately (it's the beginnings of a complete run-your-app-on-your-own-cloud solution). Jens is/was writing an SQLite backend, and there's my own project, BDBDatastore, which uses BDB-JE as the backend, and is fully functional (though beta quality). AppDrop, which others have mentioned, simply uses the development server as a backend, and hence isn't suitable for production use.
The users API needs replacing with something else, such as an OpenID based API. Again, fairly simple, but no premade solutions yet.
The Memcache API needs a backend that uses standard C memcache backends.
The other APIs have perfectly functional backends as part of the SDK, so don't really need porting.
Cron support would also need implementing, as would background processing, XMPP, etc, when they become available.
As you can see, there's a lot of work to be done, but no fundamental barriers to making your App Engine app run outside Google's environment. In fact, if you're interested, you're more than welcome to participate - I and others have plans to combine the solutions for the various pieces into a single 'OpenEngine' solution for hosting your own apps.
Use a high level framework that works on App-Engine. That way you can port your code to other servers when you want.
django has been patched and ported to work in the Appengine patch project and is the most used FW on appengine.
You may want to refer this step by step intro to running a django app on App engine
As far as the parallel infrastructure to run an app engine application is concerned, it is still way far. App Engine itself hasn't got as popular as people believed it to and google wanted it to be. Plus it is harder to develop on the builtin WebApp framework than on django.
Its quite unlikely to see a parallel infrastructure to run app engine application on, atleast for years to come. Rather it is likely to see django and other popular frameworks work out of the box on app engine and the work on this is currently underway in the referred project.
You can build AppEngine applications using the Django python framework (although the supported version is a bit behind the most recent Django release). Where you lose portability (at least right now) is when using GQL/BigTable for persistence. This is Google proprietary database platform. As Hank mentioned this is one of the biggest reasons to actually use AppEngine, but it is also the single largest locking point.
Here are a couple of links to Django support in AppEngine and GQL/BigTable:
http://code.google.com/appengine/articles/django.html
http://code.google.com/appengine/docs/python/datastore/gqlreference.html
So far, I found an experimental host called app-drop which is capable of hosting google app-engine projects. This should mean that it's atleast possible to run app engine projects outside of google's infrastructure.
This is however clearly not yet suitable for production.
The code should be mostly portable (they do a pretty good job of indicating which modules you can't use on AppEngine and which AppEngine-specific code corresponds to which forbidden modules), but the whole point of AppEngine is to get access to Google's infrastructure. There's not much point to writing your code to the AppEngine restrictions if you aren't going to be using their infrastructure.
AppDrop is a proof of concept port of AppEngine to Amazon Web Services / Elastic Computing completed in April of 2008. It uses a flat file instead of BigTable and runs in a single instance, so there are scaling issues; but it's developer says it took him only four days, and perhaps these limitations can be addressed by others.
I did the reverse migration from vanilla Unix to app engine recently very easily by using WHIFF resources. Basically configure anything platform dependant as a resource and then swap/replace the resources on different configurations.
http://piopio.appspot.com/W1000_1000.resources
also see
http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1200.wwiki
for a detailed example of resource swapping/configuration.
(note: links may go away eventually, app is experimental.)
Check out typhoonae. it's in beta, but quite usable – we moved one of our apps to inhouse server running this stack.
AppScale is the most mature open source implementation of Google App Engine. It's been in development since 2008 and currently support all four languages: Python, Java, Go, and PHP. It has users running their application in production today.
The FAQ explains what APIs are supported and what is lacking:
https://github.com/AppScale/appscale/wiki/FAQs
(Disclaimer: I work on the project)

Categories