1. create django project
django-admin.py startproject Test
2. add main.py in project:
# Google App Engine imports.
from google.appengine.ext.webapp import util
from django.core.management import setup_environ
import settings
setup_environ(settings)
# Force Django to reload its settings.
from django.conf import settings
settings._target = None
import django.core.handlers.wsgi
import django.core.signals
import django.db
import django.dispatch.dispatcher
# Unregister the rollback event handler.
django.dispatch.dispatcher.disconnect(
django.db._rollback_on_exception,
django.core.signals.got_request_exception)
def main():
# Create a Django application for WSGI.
application = django.core.handlers.wsgi.WSGIHandler()
# Run the WSGI CGI handler with that application.
util.run_wsgi_app(application)
if __name__ == '__main__':
main()
3. add app.yaml in project
application: test
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: main.py
4. dev_appserver.py Test