我在输入时遇到了这个问题localhost:8000/admin/
。
`TemplateSyntaxError: 无法解析剩余部分:来自 'admin:password_change' 的 ':password_change'。'url' 的语法在 Django 1.5 中发生了变化,请参阅文档。
这是我的一部分settings.py
:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'grappelli',
'filebrowser',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
#'django.contrib.admindocs',
'tinymce',
'sorl.thumbnail',
'south',
'django_facebook',
'djcelery',
'devserver',
'main',
)
AUTH_USER_MODEL = 'django_facebook.FacebookCustomUser'
AUTHENTICATION_BACKENDS = (
'django_facebook.auth_backends.FacebookBackend',
'django.contrib.auth.backends.ModelBackend',
# Uncomment the following to make Django tests pass:
'django.contrib.auth.backends.ModelBackend',
)
我做错什么了吗?
PS:这是我的完整追溯 https://gist.github.com/anonymous/e8c1359d384df7a6b405
编辑:
我根据请求粘贴 grep 的输出:
$ ack-grep --type=python -r ':password_change' .
lib/python2.7/site-packages/django/contrib/admin/sites.py
264:url = reverse('admin:password_change_done', current_app=self.name)
lib/python2.7/site-packages/grappelli/dashboard/dashboards.py
147:reverse('%s:password_change' % site_name)],
$ ack-grep --type=html -r ':password_change' .
lib/python2.7/site-packages/django/contrib/admin/templates/admin/base.html
36:<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
lib/python2.7/site-packages/grappelli/templates/admin/includes_grappelli/header.html
12:{% url admin:password_change as password_change_url %}