我完全不明白這個錯誤。我使用django-nonrel,通過manage.py將其上傳到我的應用程序。而有時我有這樣的:谷歌應用引擎Django的路徑
<type 'exceptions.AttributeError'>: 'Settings' object has no attribute 'DATABASE_ROUTERS'
Traceback (most recent call last):
File "/base/data/home/apps/appid/3.347077242893060339/execute.py", line 2, in <module>
from djapp import queue_controller
File "/base/data/home/apps/appid/3.347077242893060339/djapp/queue_controller.py", line 5, in <module>
from djapp.models import Operation
File "/base/data/home/apps/appid/3.347077242893060339/djapp/models.py", line 3, in <module>
from django.db import models
File "/base/data/home/apps/appid/3.347077242893060339/django/db/__init__.py", line 66, in <module>
router = ConnectionRouter(settings.DATABASE_ROUTERS)
File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/conf/__init__.py", line 32, in __getattr__
return getattr(self._target, name)
或
<type 'exceptions.ImportError'>: No module named files.uploadhandler
Traceback (most recent call last):
File "/base/data/home/apps/appid/3.347067228745038183/djangoappengine/main/main.py", line 28, in <module>
from django.core.handlers.wsgi import WSGIHandler
File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/core/handlers/wsgi.py", line 1, in <module>
from django.core.handlers.base import BaseHandler
File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/core/handlers/base.py", line 3, in <module>
from django import http
File "/base/data/home/apps/appid/3.347067228745038183/django/http/__init__.py", line 28, in <module>
from django.http.multipartparser import MultiPartParser
File "/base/data/home/apps/appid/3.347067228745038183/django/http/multipartparser.py", line 14, in <module>
from django.core.files.uploadhandler import StopUpload, SkipFile, StopFutureHandlers
什麼是錯的路徑?爲什麼會發生?首先,路徑是「/base/data/home/apps/app-id/3.347046818251769742/django/」,然後是「/base/python_runtime/python_lib/versions/third_party/django-0.96/django/」。
以及如何避免此錯誤?
我已經檢查sys.path中,上傳了新的Django幾次,去掉所有不需要的文件,我失去了:(
sys.path = ['/base/data/home/apps/appid/3.347077364008022180',
'/base/data/home/apps/appid/3.347077364008022180/djangoappengine/lib',
'/base/python_runtime/python_dist/lib/python25.zip',
'/base/python_runtime/python_dist/lib/python2.5/',
'/base/python_runtime/python_dist/lib/python2.5/plat-linux2',
'/base/python_runtime/python_dist/lib/python2.5/lib-tk',
'/base/python_runtime/python_dist/lib/python2.5/lib-dynload',
'/base/python_runtime/python_lib/versions/1',
'/base/data/home/apps/appid/3.347077364008022180/']
您使用的是appstats嗎?當nonrel在該實例上使用之前,實例加載默認的Django時,似乎會發生這種事情。 – geoffspear 2010-12-20 16:55:14
我上傳了「appengine console」應用程序,它也加載了django,然後將其刪除。現在我的應用程序中只有django-nonrel和wave robot api。一個實例如何加載默認的Django? – shmakova 2010-12-21 21:05:10