我使用的是Django 1.8,我无法再访问管理面板了。这是错误:
反向' app_list'参数'()'和关键字参数' {' app_label':' my_app'}'未找到。尝试了0个模式:[]`
my_app
是我创建的自定义应用,它位于INSTALLED_APPS
内。我试图从那里删除它,也删除app文件夹。
它并不总是与未找到相同的应用,有时它是另一个自定义应用,有时它是Django auth
应用,或第三方应用,它&# 39;真的很随意。
这里是追溯(http://dpaste.com/2W7MJV7):
Traceback:
File "/usr/local/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.4/site-packages/django/contrib/admin/sites.py" in wrapper
254. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/django/utils/decorators.py" in _wrapped_view
110. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/django/contrib/admin/sites.py" in inner
233. return view(request, *args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/django/contrib/admin/sites.py" in index
438. current_app=self.name,
File "/usr/local/lib/python3.4/site-packages/django/core/urlresolvers.py" in reverse
579. return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
File "/usr/local/lib/python3.4/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix
496. (lookup_view_s, args, kwargs, len(patterns), patterns))
Exception Type: NoReverseMatch at /admin/
Exception Value: Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': 'ttn'}' not found. 0 pattern(s) tried: []
这是主要的urls.py文件:
from django.conf.urls import include, url
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import login_required
from django.contrib import admin
from django.views.generic import TemplateView, RedirectView
urlpatterns = [
# apps
url(r'', include('ttn.urls', namespace='ttn')),
# admin panel
url(r'^admin/', include(admin.site.urls)),
]