27

I wanted to check the status of running Django on the Google App Engine currently and what the benefits of running django on GAE over simply using Webapp.

Django main killer feature, IMHO, is the reuseable apps and middleware. Unfortunately, most current Django apps use models or model forms (django-tags, django-reviews, django-profiles, Pinax apps).

So what are the remaining features or benefits that django has that can still run in Google App Engine (other than what's disabled: the popular django apps, session and authentication middleware, users and admin, models, etc).

Also, is there a list of the Django apps that work in App Engine as well?

1

7 Answers 7

11

app-engine-patch currently has the most of django functional, including sessions, contrib.auth, sites, and some other standard django apps. However, its main drawback (my opinion) is that it uses a zip file of a modified version of django to achieve this functionality and the current maintainers don't seem to have kept pace with current django releases. Currently it seems to be the consensus of the past and present maintainers that this approach is too cumbersome to maintain and therefore no one is currently maintaining it.

google-app-engine-django, uses a monkey patch approach of the latest django version included in the production GAE runtime, so as long as google continues to track django releases you'll be kept up to date regarding django. However, it currently has not fully ported contrib.auth, so you can only authenticate with google accounts - which can be a big drawback depending on whether you want contrib.auth User models to work as you know them on sql backends. There is also no django admin support in the helper as there is in app-engine-patch. A fork of django-app-engine-django exists which adds in some of the contrib apps, such as flatpages, sites, and sitemaps. Also note, it only works on django versions up to 1.1, until issue #3230 Django 1.2 is added to use_library, unless you upload django as a zip file.

On the horizon, the original developer of app-engine-patch has been working on the django-nonrel branch, but this may be pretty far away from being included in a django release. This django developers thread has a lot of information about these efforts.

Separately, there is a google summer of code project working on integrating some aspects of nonrel db's.

1
  • Thanks. It's very nice to see django support for gae going in a better direction and that this goal hasn't been abandoned.
    – notnoop
    Commented Jan 4, 2010 at 16:47
3

app-engine-patch gets most of those things working inside AppEngine - so you can (mostly) use straight Modelforms, use the Django users and admin, etc.

I've only used it for fairly simple projects (being quite new to django), but they claim that most Django apps will work with (at most) minor modifications on appengine. For instance, app-engine-patch uses the AppEngine Model classes rather than the Django classes; and there are some of the basic views that are too inefficient to run on Appengine.

added: google-app-engine-django is similar; but provides a BaseModel that appears identical to Django's BaseModel. My understand is that google-app-engine-django was released by Google, then forked to create app-engine-patch. The maintainers of app-engine-patch seem to have some different goals from the creators of google-app-engine-django, so you may find that one of the two suits your needs better than the other.

Google have provided some articles on running Django apps on appengine; the most recent is actually a guest post from the authors of app-engine-patch.

1
  • 1
    app-engine-patch seems to have been abandoned for the last four months, and both projects don't help with the reuseable apps (Ponix, etc). Google articles seem a bit old (only one article from May 2009, and everything else is from 2008).
    – notnoop
    Commented Jan 1, 2010 at 16:36
1

I've had the best success by simply picking and choosing the Django features that I need and patching them into webapp myself. In my latest project I actually just cut out the webapp stuff entirely. I still import and call several webapp utility functions, but it is mostly a hand rolled application built from the good parts of GAE and Django.

1

You might be interested to check out web2py, another Python framework that supposedly has less friction between GAE and a "normal" web server.

1

It is now quite easy to use full Django on GAE: https://developers.google.com/appengine/articles/django-nonrel#ps

0

The Django version provided with App Engine has been updated to 1.2.5 with the latest SDK release (1.4.2, changelog). This version is available through the use_library() declaration, so you no longer need to mess around with monkey patching to the same extent.

0

The GoogleAppEngine (GAE) Python 2.7 runtime provides several third-party libraries that your application can use, in addition to the Python standard library, GAE tools, and GAE Python runtime environment. One of them is Django. The below is copied from the GAE docs page on third-party libraries:

To use Django in Python 2.7, specify the WSGI application and Django library in app.yaml:

...
handlers:
- url: /.*
  script: main.app  # a WSGI application in the main module's global scope

libraries:
- name: django
  version: "1.2"
2
  • "However, third-party Django applications that use the Django data modeling interface—most notably Django's Admin application—may not work with App Engine directly" -- from the page.
    – notnoop
    Commented Feb 16, 2012 at 13:53
  • @notnoop Indeed. However through Google Cloud SQL, this may soon change. Standard Django model-dependent features (including the Django admin) should be supported once there's a DB deployed with the hosted App Engine app. More on this here. Commented Feb 16, 2012 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.