我在django项目中使用django-registration-redux,但是当我访问时: http://127.0.0.1:8000/accounts/register/ 它重定向到: http://127.0.0.1:8000/accounts/profile/
我尝试在settings.py中使用“ LOGIN_REDIRECT_URL ='/ accounts / register /'”,但是没有用
这是我的settings.py代码:
INSTALLED_APPS = [
#apps django
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
#apss terceros
'crispy_forms',
'registration',
#mis apps
'inicio',
'boletín',
]
和
ACCOUNT_ACTIVATION_DAYS = 7
REGISTRATION_AUTO_LOGIN = True
SITE_ID = 1
这是我的urls.py代码:
urlpatterns = [
path('admin/', admin.site.urls),
url(r'^$', views.boletin, name='boletín'),
url(r'contact/$', views.contact, name='contact'),
url(r'about/$', about, name='about'),
url(r'^accounts/', include('registration.backends.default.urls')),
]