mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-09 14:34:53 +03:00
Fix issue with Whitenoise & compressor used together
This commit is contained in:
parent
65d68033cd
commit
d0c4196390
|
@ -55,11 +55,8 @@ def check_paths(paths):
|
|||
@pytest.mark.parametrize("use_celery", BINARY_CHOICES)
|
||||
@pytest.mark.parametrize("use_mailhog", BINARY_CHOICES)
|
||||
@pytest.mark.parametrize("use_sentry", BINARY_CHOICES)
|
||||
@pytest.mark.parametrize(
|
||||
# These 2 cannot be used together, but test the other combinations
|
||||
["use_compressor", "use_whitenoise"],
|
||||
[("y", "n"), ("n", "n"), ("n", "n")],
|
||||
)
|
||||
@pytest.mark.parametrize("use_compressor", BINARY_CHOICES)
|
||||
@pytest.mark.parametrize("use_whitenoise", BINARY_CHOICES)
|
||||
def test_project_generation(
|
||||
cookies,
|
||||
context,
|
||||
|
@ -98,11 +95,8 @@ def test_project_generation(
|
|||
@pytest.mark.parametrize("use_celery", BINARY_CHOICES)
|
||||
@pytest.mark.parametrize("use_mailhog", BINARY_CHOICES)
|
||||
@pytest.mark.parametrize("use_sentry", BINARY_CHOICES)
|
||||
@pytest.mark.parametrize(
|
||||
# These 2 cannot be used together, but test the other combinations
|
||||
["use_compressor", "use_whitenoise"],
|
||||
[("y", "n"), ("n", "n"), ("n", "n")],
|
||||
)
|
||||
@pytest.mark.parametrize("use_compressor", BINARY_CHOICES)
|
||||
@pytest.mark.parametrize("use_whitenoise", BINARY_CHOICES)
|
||||
def test_linting_passes(
|
||||
cookies,
|
||||
windows,
|
||||
|
@ -113,7 +107,7 @@ def test_linting_passes(
|
|||
use_compressor,
|
||||
use_whitenoise,
|
||||
):
|
||||
"""generated project should pass flake8"""
|
||||
"""generated project should pass flake8 & black."""
|
||||
result = cookies.bake(
|
||||
extra_context={
|
||||
"windows": windows,
|
||||
|
|
|
@ -182,7 +182,7 @@ COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True)
|
|||
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_STORAGE
|
||||
COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
|
||||
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_URL
|
||||
COMPRESS_URL = STATIC_URL
|
||||
COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' %} # noqa F405{% endif %}
|
||||
{% endif %}
|
||||
{%- if cookiecutter.use_whitenoise == 'n' -%}
|
||||
# Collectfast
|
||||
|
|
Loading…
Reference in New Issue
Block a user