diff --git a/requirements.prod.txt b/requirements.prod.txt
index 0c6c43e..a08f85f 100644
--- a/requirements.prod.txt
+++ b/requirements.prod.txt
@@ -6,6 +6,7 @@ django-appconf==1.0.3
django-compressor==2.3
django-generate-secret-key==1.0.2
django-picklefield==2.0
+django-registration==3.0.1
django-sass-processor==0.7.3
django-widget-tweaks==1.4.5
idna==2.8
diff --git a/requirements.txt b/requirements.txt
index ae5aa48..1a01b94 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,11 +1,13 @@
beautifulsoup4==4.7.1
certifi==2019.6.16
chardet==3.0.4
+confusable-homoglyphs==3.2.0
Django==2.2.2
django-appconf==1.0.3
django-compressor==2.3
django-generate-secret-key==1.0.2
django-picklefield==2.0
+django-registration==3.0.1
django-sass-processor==0.7.3
django-widget-tweaks==1.4.5
idna==2.8
diff --git a/siteroot/settings/base.py b/siteroot/settings/base.py
index ade2d14..96747fb 100644
--- a/siteroot/settings/base.py
+++ b/siteroot/settings/base.py
@@ -141,3 +141,6 @@ STATICFILES_FINDERS = [
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'bookmarks', 'styles'),
]
+
+# Registration switch
+ALLOW_REGISTRATION = False
diff --git a/siteroot/settings/custom.py b/siteroot/settings/custom.py
index fcfe4e5..143330e 100644
--- a/siteroot/settings/custom.py
+++ b/siteroot/settings/custom.py
@@ -1 +1,3 @@
# Placeholder, can be mounted in a Docker container with a custom settings
+
+# ALLOW_REGISTRATION = True
diff --git a/siteroot/urls.py b/siteroot/urls.py
index a52365c..a0e9f09 100644
--- a/siteroot/urls.py
+++ b/siteroot/urls.py
@@ -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')))