views:

190

answers:

1

I'm using google-app-engine-django to run Django 1.1 on Google App Engine and I'm getting lots and lots of DeadlineExceededErrors, sometimes with . My entire app is quite simple, and it's happening throughout my app, so I suspect that there is a problem with my basic settings. Any advice would be greatly appreciated!

Sample error:

<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', '[email protected]'),
)

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
)
+3  A: 

This is a known bug that occurs intermittently for some apps. We're working on fixing it ASAP.

Nick Johnson
We being the team behind Google App Engine, google-app-engine-django, or Django? How can I help solve it?
pr1001
Google App Engine. Unfortunately, there's not much you can do, except to try and minimise the amount of stuff you import, which helps with execution time in any case.
Nick Johnson
Ouch. Do you know of any ETA on a fix?
pr1001
You can look @ http://code.google.com/p/googleappengine/issues/detail?id=1695 for more info.
wings