4

I have working project built with djangoappengine and running under App Engine dev server. So I run "manage.py runserver" and all works as appreciated. All requirements (django, djangoappengine etc) are located in project root dir. Now I am trying to use virtualenv (I am running commands in project root):

virutalenv --no-site-packages env
env\Scripts\python manage.py runserver

Server starts, but when I try to access any page I get such exception:

ImportError: Could not import settings 'settings' (Is it on sys.path? Does it have syntax errors?): No module named mimetypes

How can I fix this?

PS I am trying to use this idea on Windows: https://bitbucket.org/imbolc/gae-virtualenv/src

Edit 1. The same behaviour is under Ubuntu 10.10.

Edit 2. The same behaviour is under Mac OS X: How to use virtualenv with Google App Engine SDK on Mac OS X 10.6 . Question can be closed.

Community
  • 1
  • 1
Vladimir Mihailenco
  • 3,382
  • 2
  • 24
  • 38
  • possible duplicate of [How to use virtualenv with Google App Engine SDK on Mac OS X 10.6](http://stackoverflow.com/questions/3858772/how-to-use-virtualenv-with-google-app-engine-sdk-on-mac-os-x-10-6) – Vladimir Mihailenco Nov 05 '10 at 09:53

2 Answers2

4

This is described in Issue 4339 for GAE. Here's how to fix it:

  1. Download patch from this Issue comment: patch
  2. Move the patch to google_appengine/google/appengine/tools/
  3. Change your working directory to the same path as above
  4. Type: patch -p0 < dev_appserver.patch
Lionel
  • 3,188
  • 5
  • 27
  • 40
  • 1
    That direct link to the patch has a token which seems to expire. The patch is attached to this comment on the issue: http://code.google.com/p/googleappengine/issues/detail?id=4339#c2 – gak Sep 25 '11 at 02:32
1

Virtualenv does not copy full Python standard library, but instead bootstraps the loading of these modules with setting sys.path (PYTHONPATH). Looks like Google App Engine does not like this.

I suggest you file a bug against Google App Engine.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435