mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-09 14:34:53 +03:00
- users app main url only enabled when in DEBUG.
- Redirect after login now goes to home instead of user app
This commit is contained in:
parent
693da5645d
commit
e4501ab7ff
|
@ -98,7 +98,7 @@ AUTHENTICATION_BACKENDS = [
|
|||
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-user-model
|
||||
AUTH_USER_MODEL = 'users.User'
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url
|
||||
LOGIN_REDIRECT_URL = 'users:redirect'
|
||||
LOGIN_REDIRECT_URL = 'home'
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#login-url
|
||||
LOGIN_URL = 'account_login'
|
||||
|
||||
|
|
|
@ -15,10 +15,6 @@ urlpatterns = [
|
|||
# Django Admin, use {% raw %}{% url 'admin:index' %}{% endraw %}
|
||||
path(settings.ADMIN_URL, admin.site.urls),
|
||||
# User management
|
||||
path(
|
||||
"users/",
|
||||
include("{{ cookiecutter.project_slug }}.users.urls", namespace="users"),
|
||||
),
|
||||
path("accounts/", include("allauth.urls")),
|
||||
# Your stuff: custom urls includes go here
|
||||
] + static(
|
||||
|
@ -26,6 +22,14 @@ urlpatterns = [
|
|||
)
|
||||
|
||||
if settings.DEBUG:
|
||||
# User management
|
||||
urlpatterns += [
|
||||
path(
|
||||
"users/",
|
||||
include("{{ cookiecutter.project_slug }}.users.urls", namespace="users"),
|
||||
),
|
||||
]
|
||||
|
||||
# This allows the error pages to be debugged during development, just visit
|
||||
# these url in browser to see how these error pages look like.
|
||||
urlpatterns += [
|
||||
|
|
Loading…
Reference in New Issue
Block a user