From 4da85ac991ed658dcec705408b7fb02e9409e18b Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Sat, 3 Mar 2018 11:30:29 +0100 Subject: [PATCH] Improve the way the login url is handled --- README.md | 1 - khaganat/settings.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index a7ee661..5dbb16a 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ You can set the following variables in the `.env` file: * `KHAGANAT_STATIC_ROOT`: Absolute path to the directory where static files should be collected. * `KHAGANAT_LOGS_MIN_DAYS`: Numbers of days before logs are hidden, default is 7. * `KHAGANAT_LOGS_MAX_DAYS`: Number of days before logs are published, default is 0. -* `KHAGANAT_LOGIN_URL`: The login URL, default is `/account/login/`. * `KHAGANAT_LOGIN_REDIRECT_URL`: URL to redirect after user login. Will be reversed, default is `index`. * `KHAGANAT_REGISTER_REQUIRE_VALIDATION`: require email validation upon registration, default is true. * `KHAGANAT_EMAIL_HOST`: The host to use for sending email, default is `localhost`. diff --git a/khaganat/settings.py b/khaganat/settings.py index a2df076..53171b7 100644 --- a/khaganat/settings.py +++ b/khaganat/settings.py @@ -112,7 +112,7 @@ DEFAULT_FROM_EMAIL = config( # https://docs.djangoproject.com/en/2.0/topics/auth/customizing/ AUTH_USER_MODEL = 'neluser.NelUser' -LOGIN_URL = config('KHAGANAT_LOGIN_URL', default='/account/login/') +LOGIN_URL = reverse_lazy('login') LOGIN_REDIRECT_URL = reverse_lazy( config('KHAGANAT_LOGIN_REDIRECT_URL', default='index') )