Skip to content

Instantly share code, notes, and snippets.

@ishikawa ishikawa/main.py
Created Nov 30, 2009

Embed
What would you like to do?
main.py to use Django 1.1 on Google AppEngine SDK 1.2.7
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from google.appengine.dist import use_library
use_library('django', '1.1')
import logging
from google.appengine.ext.webapp.util import run_wsgi_app
from django import db
from django.core import signals
import django.core.handlers.wsgi
def log_exception(sender, **kwargs):
logging.exception('Exception in request:')
signals.got_request_exception.connect(log_exception)
signals.got_request_exception.disconnect(db._rollback_on_exception)
def main():
application = django.core.handlers.wsgi.WSGIHandler()
run_wsgi_app(application)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.