mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-21 17:16:51 +03:00
Add support for secure Redis (TLS support) (#5526)
This commit is contained in:
parent
d00cd42e6c
commit
7fc33c2a23
|
@ -14,6 +14,7 @@ Run these commands to deploy the project to Heroku:
|
|||
|
||||
# Note: this is not a free plan
|
||||
heroku addons:create heroku-postgresql:essential-0
|
||||
|
||||
# On Windows use double quotes for the time zone, e.g.
|
||||
# heroku pg:backups schedule --at "02:00 America/Los_Angeles" DATABASE_URL
|
||||
heroku pg:backups schedule --at '02:00 America/Los_Angeles' DATABASE_URL
|
||||
|
|
6
uv.lock
6
uv.lock
|
@ -181,7 +181,7 @@ wheels = [
|
|||
|
||||
[[package]]
|
||||
name = "cookiecutter-django"
|
||||
version = "2024.10.24"
|
||||
version = "2024.11.20"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "binaryornot" },
|
||||
|
@ -204,7 +204,7 @@ dependencies = [
|
|||
{ name = "tox-uv" },
|
||||
]
|
||||
|
||||
[package.dependency-groups]
|
||||
[package.dev-dependencies]
|
||||
docs = [
|
||||
{ name = "myst-parser" },
|
||||
{ name = "sphinx" },
|
||||
|
@ -234,7 +234,7 @@ requires-dist = [
|
|||
{ name = "tox-uv", specifier = ">=1.11.2" },
|
||||
]
|
||||
|
||||
[package.metadata.dependency-groups]
|
||||
[package.metadata.requires-dev]
|
||||
docs = [
|
||||
{ name = "myst-parser", specifier = ">=4" },
|
||||
{ name = "sphinx", specifier = ">=8.0.2" },
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# ruff: noqa: ERA001, E501
|
||||
"""Base settings to build other settings files upon."""
|
||||
|
||||
{% if cookiecutter.use_celery == 'y' -%}
|
||||
import ssl
|
||||
{%- endif %}
|
||||
from pathlib import Path
|
||||
|
||||
import environ
|
||||
|
@ -283,6 +286,7 @@ LOGGING = {
|
|||
}
|
||||
|
||||
REDIS_URL = env("REDIS_URL", default="redis://{% if cookiecutter.use_docker == 'y' %}redis{%else%}localhost{% endif %}:6379/0")
|
||||
REDIS_SSL = REDIS_URL.startswith("rediss://")
|
||||
|
||||
{% if cookiecutter.use_celery == 'y' -%}
|
||||
# Celery
|
||||
|
@ -292,8 +296,12 @@ if USE_TZ:
|
|||
CELERY_TIMEZONE = TIME_ZONE
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-broker_url
|
||||
CELERY_BROKER_URL = REDIS_URL
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#redis-backend-use-ssl
|
||||
CELERY_BROKER_USE_SSL = {"ssl_cert_reqs": ssl.CERT_NONE} if REDIS_SSL else None
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_backend
|
||||
CELERY_RESULT_BACKEND = REDIS_URL
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#redis-backend-use-ssl
|
||||
CELERY_REDIS_BACKEND_USE_SSL = CELERY_BROKER_USE_SSL
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended
|
||||
CELERY_RESULT_EXTENDED = True
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-always-retry
|
||||
|
|
Loading…
Reference in New Issue
Block a user