I\'m trying to upgrade Django to version 1.7 on a Google App Engine development server running on my Windows machine.
When trying to load the app, I get the followin
Devserver doesn't provide access to modules that are on your system. It only looks at modules that are in your project. This is to ensure that if it runs on devserver, it will run when deployed. Either use the patched version of Django on your devserver, understanding that the OS will never be 'nt' on App Engine, or import msvcrt into your project so it can be found and put a skip_files line in app.yaml when you deploy, since it will never be needed when deployed to App Engine's non-windows environment.
Just found a workaround. In appengine_config.py
add the following lines:
import os
on_appengine = os.environ.get('SERVER_SOFTWARE','').startswith('Development')
if on_appengine and os.name == 'nt':
os.name = None
I'm still looking for a less hackish solution.
I found this issue while using PyCharm. I created a new Python GAE project and indicated I wanted to include Flask. I encountered a couple of small issues while getting it up and running and this was the last one: as @Tzach pointed out, you will eventually run in to a ImportError: No module named msvcrt
while running one of these GAE/Flask/JetBrains boilerplates. Tzach's hack, however, didn't work for me -- they must have changed the Click library to detect the host OS in a different way. The solution for me ended up being the following code within appengine_config.py
:
on_appengine = os.environ.get('SERVER_SOFTWARE','').startswith('Development')
if on_appengine and os.name == 'nt':
sys.platform = "Not Windows"
The reason it changed is because it appears that Click is now using the following code to detect the OS:
WIN = sys.platform.startswith('win')
Hope that's helpful!