【发布时间】:2016-04-12 12:31:01
【问题描述】:
django-registration-redux 不工作。我已将我的设置更改为以下并运行python manage.py migrate。我不知道为什么它没有对数据库做任何事情,这是 Page not found 错误中建议的内容?
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites', # manually added
'django.contrib.messages',
'django.contrib.staticfiles',
# third party apps
'crispy_forms',
'registration', # django-registration-redux
# my apps
'newsletter',
)
# Django-registration-redux settings
ACCOUNT_ACTIVATION_DAYS = 7
REGISTRATION_AUTO_LOGIN = True
【问题讨论】:
-
你在
urls.py中添加url(r'^accounts/', include('registration.backends.default.urls')),吗? -
没有这个,它不会识别账户/东西,所以是的,这已经完成了!
-
你是对的,测试 url
http://127.0.0.1:8000/accounts/测试 urlhttp://127.0.0.1:8000/accounts/login/并检查是否有错误。/accounts/是 api 根 -
http://127.0.0.1:8000/accounts/login/给出了一个不同的错误,它根本不会出现在^accounts/DoesNotExist at /accounts/login/ -
是你手动添加的行
'django.contrib.sites',你应该添加settings.pySITE_ID = 1。阅读更多stackoverflow.com/questions/25468676/…