Implement optional registration

This commit is contained in:
Sascha Ißbrücker
2019-12-24 13:31:55 +01:00
parent a1bfb2c711
commit 1896a8136e
12 changed files with 94 additions and 21 deletions

View File

@@ -16,10 +16,16 @@ Including another URLconf
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import path, include
from .settings import ALLOW_REGISTRATION
urlpatterns = [
path('admin/', admin.site.urls),
path('login/', auth_views.LoginView.as_view(redirect_authenticated_user=True), name='login'),
path('login/', auth_views.LoginView.as_view(redirect_authenticated_user=True,
extra_context=dict(allow_registration=ALLOW_REGISTRATION)),
name='login'),
path('logout/', auth_views.LogoutView.as_view(), name='logout'),
path('', include('bookmarks.urls')),
]
if ALLOW_REGISTRATION:
urlpatterns.append(path('', include('django_registration.backends.one_step.urls')))