title: Django 1.5 on App Engine
body: <p>I'm having some difficulties setting up Django 1.5 to run via the dev_appserver.py, rather than the manage.py runserver.</p>
  
  <p>The project directory is as such: <br></p>
  
  <ul>
  <li>env</li>
  <li>myproject
  
  <ul>
  <li>manage.py</li>
  <li>myproject
  
  <ul>
  <li>init, settings, urls, wsgi (.py)</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>I've tried to two following ways to get it working with the App Engines appserver:</p>
  
  <p>app.yaml:</p>
  
  <pre><code>application: appname
  version: 1
  runtime: python27
  api_version: 1
  threadsafe: true
  
  libraries:
  - name: django
    version: "1.5"
  
  builtins:
  - django_wsgi: on
  </code></pre>
  
  <p>as suggested from this tutorial <a href="https://cloud.google.com/appengine/docs/python/cloud-sql/django" rel="nofollow">https://cloud.google.com/appengine/docs/python/cloud-sql/django</a></p>
  
  <p>It does not produce any error when setting the up the local server, but when I access the given link, I get this error:</p>
  
  <pre><code>RuntimeError: django must be included in the "libraries:" clause of your app.yaml file when using the django_wsgi builtin.
  </code></pre>
  
  <hr>
  
  <p>Next I've tried it in a slightly different way.
  With app.yaml</p>
  
  <pre><code>application: myapp
  version: 1
  runtime: python27
  api_version: 1
  threadsafe: yes
  
  handlers:
  - url: .*
    script: main.application
  
  libraries:
  - name: django
    version: "1.5"
  </code></pre>
  
  <p>and a main.py as such:</p>
  
  <pre><code>import os
  os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
  
  import django.core.handlers.wsgi
  application = django.core.handlers.wsgi.WSGIHandler()
  </code></pre>
  
  <p>which produces the following error:</p>
  
  <pre><code>  File "C:\Users\Mello\AppEngine\02\myproject\main.py", line 4, in module&gt;
  import django.core.handlers.wsgi
  ImportError: No module named django.core.handlers.wsgi
  </code></pre>
  
  <p>Even though if I run </p>
  
  <pre><code>&gt;&gt;&gt;import django.core.handlers.wsgi
  &gt;&gt;&gt;
  </code></pre>
  
  <p>in the same virtual environment, it runs fine.</p>
  
  <hr>
  
  <p>Anybody has any piece of advice to point me in the right direction to fix this?</p>
  
  <p>Thanks</p>