我正在尝试用appengine运行django项目。它在localhost上正常运行。但是当我尝试将其上传到appspot.com时,它给了我以下错误
ImportError at /
No module named response
这是traceback。
views.py
from django.http.response import HttpResponse
def home(request):
return HttpResponse("Hello World")
的app.yaml
application: demoapptotest
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.application
libraries:
- name: django
version: latest
- name: PIL
version: latest
env_variables:
DJANGO_SETTINGS_MODULE: 'app1.settings'
答案 0 :(得分:1)
你应该from django.http import HttpResponse
。