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>
|
<a class="nav-link" href="{% url 'about' %}">About</a>
|
||||||
</li>
|
</li>
|
||||||
{% if request.user.is_authenticated %}
|
{% 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">
|
<li class="nav-item">
|
||||||
{# URL provided by django-allauth/account/urls.py #}
|
{# URL provided by django-allauth/account/urls.py #}
|
||||||
<a class="nav-link" href="{% url 'account_logout' %}">{% trans "Sign Out" %}</a>
|
<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 django.urls import path
|
||||||
|
|
||||||
from {{ cookiecutter.project_slug }}.users.views import (
|
from {{ cookiecutter.project_slug }}.users.views import (
|
||||||
|
@ -8,9 +9,12 @@ from {{ cookiecutter.project_slug }}.users.views import (
|
||||||
)
|
)
|
||||||
|
|
||||||
app_name = "users"
|
app_name = "users"
|
||||||
urlpatterns = [
|
urlpatterns = []
|
||||||
path("", view=user_list_view, name="list"),
|
|
||||||
path("~redirect/", view=user_redirect_view, name="redirect"),
|
if settings.DEBUG:
|
||||||
path("~update/", view=user_update_view, name="update"),
|
urlpatterns += [
|
||||||
path("<str:username>/", view=user_detail_view, name="detail"),
|
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