mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-08 19:28:29 +02:00
Implement optional registration
This commit is contained in:
@@ -141,3 +141,6 @@ STATICFILES_FINDERS = [
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, 'bookmarks', 'styles'),
|
||||
]
|
||||
|
||||
# Registration switch
|
||||
ALLOW_REGISTRATION = False
|
||||
|
@@ -1 +1,3 @@
|
||||
# Placeholder, can be mounted in a Docker container with a custom settings
|
||||
|
||||
# ALLOW_REGISTRATION = True
|
||||
|
@@ -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')))
|
||||
|
Reference in New Issue
Block a user