views:

69

answers:

3

I am about to start ramping up on Django and develop a web app that I want to deploy on Google App Engine. I learn that Google has Django 0.96 already installed on the APP engine, but the latest "official" version of Django I see is at 1.2.3 and its a bit of an effort to install it there.

I am curious which version of Django is most widely used.

So, can you please guide me on which Django version I should ramp on and deploy based on the following criterion

  1. Stability and suitability for production release
  2. Availability for applications (or plugins) and which version is most supported by the community

Thanks a lot!

+3  A: 

Most people are currently using Django 1.2. You should not use or learn Django .96 - it's VERY old, and learning to use it won't prepare you for any non-app-engine Django work since things have changed significantly since then.

Django on App Engine is something of a pain, since you lose a lot of the ORM, which is a really nice reason to be working with Django. You also lose the ability to simply drop-in plugins and reusable apps that use any of the Django ORM. Anything with a models.py won't work.

Take a look at google-app-engine-django for help getting a more recent version running.

http://code.google.com/p/google-app-engine-django/

There is work to integrate the GAE storage engine into Django, and several projects have variously working implementations, but I wouldn't expect really good ORM support for a while yet - 1.3 (which is still several months from release) will include hooks that make it easier to write NoSQL backends, but Django probably won't ship with one.

While there are security releases for old versions of Django, you should really be developing using the latest stable version. Major releases of Django have a very strong backwards compatibility promise, so going from 1.2 to 1.3 when it comes out will be pretty seamless.

I strongly encourage you to think long and hard about what precisely App Engine offers your specific application before spending a lot of energy getting things working there. You lose application portability, scaling is still hard, and you don't save money if your application gets popular. App Engine is not a forgiving introductory platform.

For more conversation on this topic, take a look at this question:

http://stackoverflow.com/questions/1934914/

particularly my answer there and the comments on it.

Paul McMillan
Thanks! Where do you deploy your Django apps then? Any suggestions?
arbithero
I want something that is very scalable and has a Free quota. My budget is very little, so my spending on the hosting will be dependent on how much traffic I get.
arbithero
I deploy my apps with Rackspace and Slicehost in VPS setups. Since I pay for hosting already, adding another small project doesn't cost me anything, and then I can split it off if it grows. You can really deploy a Django app on most hosting. "Free" tends to bite you in the end. The Rackspace offering is very cheap (I pay $10/mo/server before bandwidth). Another option that scales easily is Amazon's AWS. They're currently offering a free "micro" instance to new customers for a year. http://aws.amazon.com/free/
Paul McMillan
The above might not be for you, since managing a server is a pretty specialized set of talents. If that's not your cup of tea, you might consider Media Temple's offering: http://mediatemple.net/webhosting/gs/features/containers.php
Paul McMillan
http://djangofriendly.com/hosts/
LaundroMat
Ah yeah, good breakdown. Webfaction is pretty popular.
Paul McMillan
Obviously I'm biased (I'm on the App Engine team), but I take issue with several of your assertions: Application portability is available with projects such as AppScale (http://googleappengine.blogspot.com/2010/10/research-project-appscale-at-university.html) and TyphoonAE (http://code.google.com/p/typhoonae/), scaling is _always_ hard, but it's easier on App Engine, you _do_ save money (http://googleappengine.blogspot.com/2010/06/how-app-engine-served-humble-indie.html) and it's an excellent introductory platform (http://code.google.com/appengine/docs/python/gettingstarted/).
Nick Johnson
Hey Nick, thanks for the comment. I wasn't aware that AppScale had become as mature as it is now, and agree that definitely does look like a good argument against the vendor lockin problem.
Paul McMillan
As far as cost, I don't have good numbers to argue from, but I would expect to be able to serve that kind of traffic for $200/mo on other hosting too. Ease of use *IS* a problem for new users. I've helped several new users with projects, and they've ALL run into the execution time limit in a legitimate fashion. App engine is great for some workloads and really bad for others. Maybe the people I was working with just picked bad tasks to do on App Engine.
Paul McMillan
@Nick Also, while we're on the subject, could you PLEASE get someone to update the doc that all the new people find that recommends Django 0.96? It has no indication that there might be newer options. http://code.google.com/appengine/articles/django.html
Paul McMillan
+3  A: 

app engine permits you to use other versions of django out of the box, with only a little pain, using google.appengine.dist.use_library. essentially, your main.py (the module specified by app.yaml to handle urls) should look like this:

import wsgiref.handlers


from google.appengine.ext import webapp
from google.appengine.ext.webapp import util

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from google.appengine.dist import use_library   # important bit
use_library('django', '1.1')

import django.core.handlers.wsgi
def main():
  application = django.core.handlers.wsgi.WSGIHandler()
  # Run the WSGI CGI handler with that application.
  webapp.util.run_wsgi_app(application)

if __name__ == '__main__':
  main()
TokenMacGuy
Yes, but Django doesn't work out of the box on App Engine, which was the whole point of the question.
Paul McMillan
The above code is specific to app engine. Using 0.98 is unconscionable, although it is the default version imported with `import django`, app engine has 1.1 available, though, which isn't nearly as painful. It's not the latest, but it's probably good enough for most uses. Unless you need a feature that is just not around in 1.1, the above method is much easier to deal with than uploading another version.
TokenMacGuy
A: 

Another thing to consider is how you install. I'd be sure to install django from SVN, because it makes updating it MUCH easier.

I have been using the dev version for a while on my site, and haven't encountered a single bug yet, aside from one that affected the admin site in a minor way (which a svn up fixed).

I don't have a feel for whether people are using 1.2 or dev, but in my experience, dev is perfectly suitable. Any major errors that you may have in the code will get fixed very quickly, and svn up will get you to the latest code on the off chance that you get a revision with a major bug.

mlissner
The dev version is relatively stable, but the build does periodically get broken. It's great for development, but I wouldn't run a production site on it.
Paul McMillan