mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-04-12 21:04:12 +03:00
Using WhiteNoise in development (#2304)
Using WhiteNoise in development
This commit is contained in:
commit
117c7d025b
|
@ -131,6 +131,9 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
# https://docs.djangoproject.com/en/dev/ref/settings/#middleware
|
||||
MIDDLEWARE = [
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||
"whitenoise.middleware.WhiteNoiseMiddleware",
|
||||
{%- endif %}
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.middleware.locale.LocaleMiddleware",
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
|
|
|
@ -42,6 +42,14 @@ EMAIL_BACKEND = env(
|
|||
)
|
||||
{%- endif %}
|
||||
|
||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||
|
||||
# WhiteNoise
|
||||
# ------------------------------------------------------------------------------
|
||||
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development
|
||||
INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405
|
||||
{% endif %}
|
||||
|
||||
# django-debug-toolbar
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites
|
||||
|
|
|
@ -194,14 +194,7 @@ ANYMAIL = {
|
|||
"MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"),
|
||||
}
|
||||
|
||||
{% if cookiecutter.use_whitenoise == 'y' -%}
|
||||
# WhiteNoise
|
||||
# ------------------------------------------------------------------------------
|
||||
# http://whitenoise.evans.io/en/latest/django.html#enable-whitenoise
|
||||
MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware") # noqa F405
|
||||
|
||||
{% endif %}
|
||||
{%- if cookiecutter.use_compressor == 'y' -%}
|
||||
{% if cookiecutter.use_compressor == 'y' -%}
|
||||
# django-compressor
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_ENABLED
|
||||
|
|
Loading…
Reference in New Issue
Block a user