Improve the way the login url is handled

This commit is contained in:
Rodolphe Breard 2018-03-03 11:30:29 +01:00
parent 9f012885b4
commit 4da85ac991
2 changed files with 1 additions and 2 deletions

View file

@ -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_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_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_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_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_REGISTER_REQUIRE_VALIDATION`: require email validation upon registration, default is true.
* `KHAGANAT_EMAIL_HOST`: The host to use for sending email, default is `localhost`. * `KHAGANAT_EMAIL_HOST`: The host to use for sending email, default is `localhost`.

View file

@ -112,7 +112,7 @@ DEFAULT_FROM_EMAIL = config(
# https://docs.djangoproject.com/en/2.0/topics/auth/customizing/ # https://docs.djangoproject.com/en/2.0/topics/auth/customizing/
AUTH_USER_MODEL = 'neluser.NelUser' AUTH_USER_MODEL = 'neluser.NelUser'
LOGIN_URL = config('KHAGANAT_LOGIN_URL', default='/account/login/') LOGIN_URL = reverse_lazy('login')
LOGIN_REDIRECT_URL = reverse_lazy( LOGIN_REDIRECT_URL = reverse_lazy(
config('KHAGANAT_LOGIN_REDIRECT_URL', default='index') config('KHAGANAT_LOGIN_REDIRECT_URL', default='index')
) )