From 6adfdbabe0d44c17f32abc9d48a6e252e2a0792e Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 17 Nov 2022 19:16:34 -0700 Subject: Add signup and password reset --- takahe/settings/base.py | 5 +++++ takahe/settings/development.py | 2 ++ takahe/urls.py | 6 ++++-- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'takahe') diff --git a/takahe/settings/base.py b/takahe/settings/base.py index dd89818..04a43dd 100644 --- a/takahe/settings/base.py +++ b/takahe/settings/base.py @@ -108,6 +108,11 @@ STATICFILES_DIRS = [ ALLOWED_HOSTS = ["*"] +MAIN_DOMAIN = os.environ["TAKAHE_MAIN_DOMAIN"] +if "/" in MAIN_DOMAIN: + print("TAKAHE_MAIN_DOMAIN should be just the domain name - no https:// or path") + +EMAIL_FROM = os.environ["TAKAHE_EMAIL_FROM"] # Note that this MUST be a fully qualified URL in production MEDIA_URL = os.environ.get("TAKAHE_MEDIA_URL", "/media/") diff --git a/takahe/settings/development.py b/takahe/settings/development.py index 051b4fb..30f74a0 100644 --- a/takahe/settings/development.py +++ b/takahe/settings/development.py @@ -16,3 +16,5 @@ CSRF_TRUSTED_ORIGINS = [ "http://127.0.0.1:8000", "https://127.0.0.1:8000", ] + +EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" diff --git a/takahe/urls.py b/takahe/urls.py index 0b23d7d..5c0b182 100644 --- a/takahe/urls.py +++ b/takahe/urls.py @@ -82,8 +82,10 @@ urlpatterns = [ path("@/posts//boost/", posts.Boost.as_view()), path("@/posts//unboost/", posts.Boost.as_view(undo=True)), # Authentication - path("auth/login/", auth.Login.as_view()), - path("auth/logout/", auth.Logout.as_view()), + path("auth/login/", auth.Login.as_view(), name="login"), + path("auth/logout/", auth.Logout.as_view(), name="logout"), + path("auth/signup/", auth.Signup.as_view(), name="signup"), + path("auth/reset//", auth.Reset.as_view(), name="password_reset"), # Identity selection path("@/activate/", identity.ActivateIdentity.as_view()), path("identity/select/", identity.SelectIdentity.as_view()), -- cgit v1.2.3