User app is now enabled with USER_APP_URLS_ENABLED setting

This commit is contained in:
Demetris Stavrou 2019-04-03 00:13:00 +03:00
parent 133aab2638
commit 0dd4ebb93b
3 changed files with 15 additions and 1 deletions

View File

@ -269,5 +269,11 @@ INSTALLED_APPS += ["compressor"]
STATICFILES_FINDERS += ["compressor.finders.CompressorFinder"]
{%- endif %}
# USER APPLICATION
# ------------------------------------------------------------------------------
# Enable the User application. Note that this is a placeholder application
# and should not be used as is in production.
USER_APP_URLS_ENABLED = True
# Your stuff...
# ------------------------------------------------------------------------------

View File

@ -287,5 +287,12 @@ sentry_sdk.init(
sentry_sdk.init(dsn=SENTRY_DSN, integrations=[sentry_logging, DjangoIntegration()])
{% endif -%}
{% endif %}
# USER APPLICATION
# ------------------------------------------------------------------------------
# Enable the User application. Note that this is a placeholder application
# and should not be used as is in production.
USER_APP_URLS_ENABLED = False
# Your stuff...
# ------------------------------------------------------------------------------

View File

@ -17,12 +17,13 @@ urlpatterns = [
# Your stuff: custom urls includes go here
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if settings.DEBUG:
if settings.USER_APP_URLS_ENABLED:
# User management
urlpatterns += [
path("users/", include("{{ cookiecutter.project_slug }}.users.urls", namespace="users"))
]
if settings.DEBUG:
# 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 += [