Permalink
Browse files

wsgi.py

The ``wsgi.py`` file will bridge between the ``python`` service and our
Django app.

We need two things here:

* inject the ``DJANGO_SETTINGS_MODULE`` variable into the environment,
  pointing to our project settings module;
* setup the ``application`` callable, since that is what the DotCloud
  service will be looking for.

..

We can now push our application, by running ``dotcloud push djangotutorial``
(you can of course use any application name you like). A Python service
will be created, the code will be deployed, and the URL of the service
will be shown at the end of the build. If you go to this URL, you will
see the plain and boring Django page, typical of the "just started"
project.
  • Loading branch information...
1 parent 125f003 commit 97b890f975d2ca3a109067d55a9ca0fdab94f9ae @jpetazzo committed Aug 31, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 wsgi.py
View
@@ -0,0 +1,4 @@
+import os
+os.environ['DJANGO_SETTINGS_MODULE'] = 'hellodjango.settings'
+import django.core.handlers.wsgi
+application = django.core.handlers.wsgi.WSGIHandler()

0 comments on commit 97b890f

Please sign in to comment.