完整的错误信息如下:
Django版本:1.3 Python版本:2.6.5 已安装应用程序: ['django.contrib.auth','django.contrib.contenttypes', 'django.contrib.sessions','django.contrib.sites','django.contrib.admin', 'esp.datatree','esp.users','esp.membership','esp.miniblog', 'esp.web','esp.program','esp.program.modules','esp.dbmail', 'esp.cal','esp.lib','esp.setup','esp.qsd','esp.qsdmedia', 'esp.resources','esp.gen_media','esp.dblog','esp.membership', 'esp.queue','esp.survey','esp.accounting_core','esp.accounting_docs', 'esp.shortterm','esp.utils','esp.cache','esp.cache_loader','esp.tagdict', 'django_extensions','south','sslauth'] 已安装中间件: ['esp.middleware.threadlocalrequest.ThreadLocals', 'esp.middleware.FixIEMiddleware', 'esp.middleware.ESPErrorMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'esp.middleware.espauthmiddleware.ESPAuthMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.doc.XViewMiddleware', 'sslauth.middleware.SSLAuthMiddleware', 'django.middleware.gzip.GZipMiddleware', 'esp.middleware.PrettyErrorEmailMiddleware', 'esp.middleware.StripWhitespaceMiddleware', 'django.middleware.transaction.TransactionMiddleware', 'esp.datatree.middleware.DataTreeLockMiddleware']
回溯: 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/handlers/base.py”中的get_response函数 101. request.path_info) 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/urlresolvers.py”中的resolve函数 250. for pattern in self.url_patterns: 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/urlresolvers.py”中的_get_url_patterns函数 279. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/urlresolvers.py”中的_get_urlconf_module函数 274. self._urlconf_module = import_module(self.urlconf_name) 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/utils/importlib.py”中的import_module函数 35. __import__(name) 文件“/home/lakshay/mysite/esp/esp/esp/../esp/urls.py”中的58行
异常类型:AttributeError 异常值:'AdminSite'对象没有属性'root'
跟踪: File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/home/lakshay/mysite/esp/esp/esp/../esp/web/views/main.py" in home 79. nav_category, created = NavBarCategory.objects.get_or_create(name='home') File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/manager.py" in get_or_create 135. return self.get_query_set().get_or_create(**kwargs) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in get_or_create 378. return self.get(**lookup), False File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in get 344. num = len(clone) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in __len__ 82. self._result_cache = list(self.iterator()) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in iterator 273. for row in compiler.results_iter(): File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/sql/compiler.py" in results_iter 680. for rows in self.execute_sql(MULTI): File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/sql/compiler.py" in execute_sql 735. cursor.execute(sql, params) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/backends/util.py" in execute 34. return self.cursor.execute(sql, params) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/backends/postgresql_psycopg2/base.py" in execute 44. return self.cursor.execute(query, args)
异常类型:DatabaseError at / 异常信息:relation "web_navbarcategory" does not exist LINE 1: ...me", "web_navbarcategory"."long_explanation" FROM "web_navba... ^
环境: 请求方法:GET 请求URL:http://localhost:8000/
在将Django应用程序作为本地主机在Apache上运行时发生AttributeError--“Adminsite”对象没有属性“root”
Django版本:1.3 Python版本:2.6.5 已安装应用程序: ['django.contrib.auth','django.contrib.contenttypes', 'django.contrib.sessions','django.contrib.sites','django.contrib.admin', 'esp.datatree','esp.users','esp.membership','esp.miniblog', 'esp.web','esp.program','esp.program.modules','esp.dbmail', 'esp.cal','esp.lib','esp.setup','esp.qsd','esp.qsdmedia', 'esp.resources','esp.gen_media','esp.dblog','esp.membership', 'esp.queue','esp.survey','esp.accounting_core','esp.accounting_docs', 'esp.shortterm','esp.utils','esp.cache','esp.cache_loader','esp.tagdict', 'django_extensions','south','sslauth'] 已安装中间件: ['esp.middleware.threadlocalrequest.ThreadLocals', 'esp.middleware.FixIEMiddleware', 'esp.middleware.ESPErrorMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'esp.middleware.espauthmiddleware.ESPAuthMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.doc.XViewMiddleware', 'sslauth.middleware.SSLAuthMiddleware', 'django.middleware.gzip.GZipMiddleware', 'esp.middleware.PrettyErrorEmailMiddleware', 'esp.middleware.StripWhitespaceMiddleware', 'django.middleware.transaction.TransactionMiddleware', 'esp.datatree.middleware.DataTreeLockMiddleware']
回溯: 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/handlers/base.py”中的get_response函数 101. request.path_info) 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/urlresolvers.py”中的resolve函数 250. for pattern in self.url_patterns: 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/urlresolvers.py”中的_get_url_patterns函数 279. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/urlresolvers.py”中的_get_urlconf_module函数 274. self._urlconf_module = import_module(self.urlconf_name) 文件“/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/utils/importlib.py”中的import_module函数 35. __import__(name) 文件“/home/lakshay/mysite/esp/esp/esp/../esp/urls.py”中的58行
异常类型:AttributeError 异常值:'AdminSite'对象没有属性'root'
回应Aldarund的编辑:
是的,我已经更正了管理员的URL,但现在它出现了数据库错误。可能是什么问题?这是追溯信息:
环境: 请求方法:GET 请求URL:http://127.0.0.1:8000/跟踪: File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/home/lakshay/mysite/esp/esp/esp/../esp/web/views/main.py" in home 79. nav_category, created = NavBarCategory.objects.get_or_create(name='home') File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/manager.py" in get_or_create 135. return self.get_query_set().get_or_create(**kwargs) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in get_or_create 378. return self.get(**lookup), False File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in get 344. num = len(clone) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in __len__ 82. self._result_cache = list(self.iterator()) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in iterator 273. for row in compiler.results_iter(): File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/sql/compiler.py" in results_iter 680. for rows in self.execute_sql(MULTI): File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/models/sql/compiler.py" in execute_sql 735. cursor.execute(sql, params) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/backends/util.py" in execute 34. return self.cursor.execute(sql, params) File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/db/backends/postgresql_psycopg2/base.py" in execute 44. return self.cursor.execute(query, args)
异常类型:DatabaseError at / 异常信息:relation "web_navbarcategory" does not exist LINE 1: ...me", "web_navbarcategory"."long_explanation" FROM "web_navba... ^