mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-09 06:24:52 +03:00
Enables User app only when DEBUG=True in settings
This commit is contained in:
parent
7485ac28be
commit
6076b38ce8
|
@ -52,10 +52,6 @@
|
|||
<a class="nav-link" href="{% url 'about' %}">About</a>
|
||||
</li>
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
{# URL provided by django-allauth/account/urls.py #}
|
||||
<a class="nav-link" href="{% url 'users:detail' request.user.username %}">{% trans "My Profile" %}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
{# URL provided by django-allauth/account/urls.py #}
|
||||
<a class="nav-link" href="{% url 'account_logout' %}">{% trans "Sign Out" %}</a>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
from django.conf import settings
|
||||
from django.urls import path
|
||||
|
||||
from {{ cookiecutter.project_slug }}.users.views import (
|
||||
|
@ -8,9 +9,12 @@ from {{ cookiecutter.project_slug }}.users.views import (
|
|||
)
|
||||
|
||||
app_name = "users"
|
||||
urlpatterns = [
|
||||
path("", view=user_list_view, name="list"),
|
||||
path("~redirect/", view=user_redirect_view, name="redirect"),
|
||||
path("~update/", view=user_update_view, name="update"),
|
||||
path("<str:username>/", view=user_detail_view, name="detail"),
|
||||
]
|
||||
urlpatterns = []
|
||||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += [
|
||||
path("", view=user_list_view, name="list"),
|
||||
path("~redirect/", view=user_redirect_view, name="redirect"),
|
||||
path("~update/", view=user_update_view, name="update"),
|
||||
path("<str:username>/", view=user_detail_view, name="detail"),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user