mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-29 13:04:05 +03:00
set SERVERS in production settings instead of base settings (#3609)
fixes https://github.com/cookiecutter/cookiecutter-django/issues/3593
This commit is contained in:
parent
33af8e3988
commit
fc081ce1fe
|
@ -350,10 +350,6 @@ SPECTACULAR_SETTINGS = {
|
||||||
"DESCRIPTION": "Documentation of API endpoints of {{ cookiecutter.project_name }}",
|
"DESCRIPTION": "Documentation of API endpoints of {{ cookiecutter.project_name }}",
|
||||||
"VERSION": "1.0.0",
|
"VERSION": "1.0.0",
|
||||||
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"],
|
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"],
|
||||||
"SERVERS": [
|
|
||||||
{"url": "http://127.0.0.1:8000", "description": "Local Development server"},
|
|
||||||
{"url": "https://{{ cookiecutter.domain_name }}", "description": "Production server"},
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
# Your stuff...
|
# Your stuff...
|
||||||
|
|
|
@ -368,5 +368,15 @@ sentry_sdk.init(
|
||||||
traces_sample_rate=env.float("SENTRY_TRACES_SAMPLE_RATE", default=0.0),
|
traces_sample_rate=env.float("SENTRY_TRACES_SAMPLE_RATE", default=0.0),
|
||||||
)
|
)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if cookiecutter.use_drf == "y" -%}
|
||||||
|
|
||||||
|
# django-rest-framework
|
||||||
|
# -------------------------------------------------------------------------------
|
||||||
|
# Tools that generate code samples can use SERVERS to point to the correct domain
|
||||||
|
SPECTACULAR_SETTINGS["SERVERS"] = [ # noqa F405
|
||||||
|
{"url": "https://{{ cookiecutter.domain_name }}", "description": "Production server"}
|
||||||
|
]
|
||||||
|
|
||||||
|
{%- endif %}
|
||||||
# Your stuff...
|
# Your stuff...
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user