Change import ssl settings to conditional

The ssl module is only used in Celery SSL settings, so it is not actually used when the use_celery option is 'n'. I modified it to import conditionally as follows.
This commit is contained in:
qwerrrqw 2024-11-21 13:29:16 +09:00
parent 92a0fdcf1b
commit 9e243001f0

View File

@ -2,10 +2,13 @@
"""Base settings to build other settings files upon."""
from pathlib import Path
import ssl
import environ
{% if cookiecutter.use_celery == 'y' %}
import ssl
{% endif %}
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# {{ cookiecutter.project_slug }}/
APPS_DIR = BASE_DIR / "{{ cookiecutter.project_slug }}"