我正在使用google-app-engine-django在Google App Engine上运行Django 1.1,而且我收到了很多DeadlineExceededErrors,有时还有。我的整个应用程序非常简单,并且它发生在我的应用程序中,因此我怀疑我的基本设置存在问题。任何建议将不胜感激!
示例错误:
<class 'google.appengine.runtime.DeadlineExceededError'>:
Traceback (most recent call last):
File "/base/data/home/apps/coffeeshopprapp/1.337356339816540588/main.py", line 38, in <module>
import django.core.handlers.wsgi
File "/base/python_lib/versions/third_party/django-1.1/django/core/handlers/wsgi.py", line 11, in <module>
from django.core.urlresolvers import set_script_prefix
File "/base/python_lib/versions/third_party/django-1.1/django/core/urlresolvers.py", line 8, in <module>
"""
的app.yaml
application: coffeeshopprapp
version: 1
runtime: python
api_version: 1
handlers:
- url: /media
static_dir: media
- url: /admin.*
script: main.py
login: admin
- url: /.*
script: main.py
main.py
import os
import sys
import logging
from appengine_django import InstallAppengineHelperForDjango
InstallAppengineHelperForDjango()
from appengine_django import have_django_zip
from appengine_django import django_zip_path
# Google App Engine imports.
from google.appengine.ext.webapp import util
# Import the part of Django that we use here.
import django.core.handlers.wsgi
def main():
# Ensure the Django zipfile is in the path if required.
if have_django_zip and django_zip_path not in sys.path:
sys.path.insert(1, django_zip_path)
# Create a Django application for WSGI.
application = django.core.handlers.wsgi.WSGIHandler()
# Run the WSGI CGI handler with that application.
util.run_wsgi_app(application)
if __name__ == '__main__':
main()
settings.py
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'appengine'
DATABASE_NAME = ''
DATABASE_USER = ''
DATABASE_PASSWORD = ''
DATABASE_HOST = ''
DATABASE_PORT = ''
TIME_ZONE = 'UTC'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
MEDIA_ROOT = ''
MEDIA_URL = ''
ADMIN_MEDIA_PREFIX = '/media/'
SECRET_KEY = 'some_secret_key'
EMAIL_HOST = ''
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware'
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
)
ROOT_URLCONF = 'urls'
ROOT_PATH = os.path.dirname(__file__)
TEMPLATE_DIRS = (
os.path.join(ROOT_PATH, 'templates')
)
INSTALLED_APPS = (
'appengine_django',
'coffeeshoppr' # my app
)
答案 0 :(得分:3)
对于某些应用,这是间歇性发生的已知错误。我们正在努力尽快修复它。