2017-01-17 06:38:52 +03:00
|
|
|
from .base import * # noqa
|
2018-03-06 19:56:27 +03:00
|
|
|
from .base import env
|
2015-04-20 00:09:00 +03:00
|
|
|
|
2018-03-06 14:28:25 +03:00
|
|
|
# GENERAL
|
2018-03-04 17:51:37 +03:00
|
|
|
# ------------------------------------------------------------------------------
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
|
2018-05-14 10:21:33 +03:00
|
|
|
DEBUG = True
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
2019-03-18 20:49:43 +03:00
|
|
|
SECRET_KEY = env(
|
|
|
|
"DJANGO_SECRET_KEY",
|
|
|
|
default="!!!SET DJANGO_SECRET_KEY!!!",
|
|
|
|
)
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
2019-03-18 20:49:43 +03:00
|
|
|
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"]
|
2018-03-04 17:51:37 +03:00
|
|
|
|
2018-03-06 14:28:25 +03:00
|
|
|
# CACHES
|
2015-04-20 00:09:00 +03:00
|
|
|
# ------------------------------------------------------------------------------
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#caches
|
|
|
|
CACHES = {
|
2019-03-18 20:49:43 +03:00
|
|
|
"default": {
|
|
|
|
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
|
|
|
|
"LOCATION": "",
|
2018-03-06 14:28:25 +03:00
|
|
|
}
|
|
|
|
}
|
2015-04-20 00:09:00 +03:00
|
|
|
|
2018-03-06 14:28:25 +03:00
|
|
|
# EMAIL
|
2015-04-20 00:09:00 +03:00
|
|
|
# ------------------------------------------------------------------------------
|
2018-03-06 14:28:25 +03:00
|
|
|
{% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' -%}
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-host
|
2019-03-18 20:49:43 +03:00
|
|
|
EMAIL_HOST = env("EMAIL_HOST", default="mailhog")
|
2019-08-21 18:28:55 +03:00
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-port
|
|
|
|
EMAIL_PORT = 1025
|
2018-03-06 14:28:25 +03:00
|
|
|
{%- elif cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'n' -%}
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-host
|
2019-03-18 20:49:43 +03:00
|
|
|
EMAIL_HOST = "localhost"
|
2019-08-21 18:28:55 +03:00
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-port
|
|
|
|
EMAIL_PORT = 1025
|
2018-03-06 14:28:25 +03:00
|
|
|
{%- else -%}
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
|
2019-03-18 20:49:43 +03:00
|
|
|
EMAIL_BACKEND = env(
|
|
|
|
"DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend"
|
|
|
|
)
|
2018-03-06 14:28:25 +03:00
|
|
|
{%- endif %}
|
2014-05-25 18:50:13 +04:00
|
|
|
|
2019-11-07 13:59:23 +03:00
|
|
|
{%- 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 %}
|
|
|
|
|
2015-04-20 00:09:00 +03:00
|
|
|
# django-debug-toolbar
|
|
|
|
# ------------------------------------------------------------------------------
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites
|
2019-03-18 20:49:43 +03:00
|
|
|
INSTALLED_APPS += ["debug_toolbar"] # noqa F405
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware
|
2019-03-18 20:49:43 +03:00
|
|
|
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa F405
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config
|
2015-04-20 00:09:00 +03:00
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
2019-03-18 20:49:43 +03:00
|
|
|
"DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"],
|
|
|
|
"SHOW_TEMPLATE_CONTEXT": True,
|
2015-04-20 00:09:00 +03:00
|
|
|
}
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
|
2019-03-18 20:49:43 +03:00
|
|
|
INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
|
2018-03-06 14:28:25 +03:00
|
|
|
{% if cookiecutter.use_docker == 'y' -%}
|
2019-03-18 20:49:43 +03:00
|
|
|
if env("USE_DOCKER") == "yes":
|
2018-05-09 13:15:35 +03:00
|
|
|
import socket
|
2019-03-18 20:49:43 +03:00
|
|
|
|
2018-03-08 15:54:24 +03:00
|
|
|
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
|
2020-04-08 01:29:46 +03:00
|
|
|
INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
|
2020-10-04 19:31:09 +03:00
|
|
|
{%- if cookiecutter.js_task_runner == 'Gulp' %}
|
2020-09-30 11:14:21 +03:00
|
|
|
_, _, ips = socket.gethostbyname_ex("node")
|
|
|
|
INTERNAL_IPS.extend(ips)
|
2020-10-04 19:31:09 +03:00
|
|
|
{%- endif %}
|
2018-03-06 14:28:25 +03:00
|
|
|
{%- endif %}
|
2014-05-25 18:50:13 +04:00
|
|
|
|
2015-04-26 08:08:23 +03:00
|
|
|
# django-extensions
|
|
|
|
# ------------------------------------------------------------------------------
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration
|
2019-03-18 20:49:43 +03:00
|
|
|
INSTALLED_APPS += ["django_extensions"] # noqa F405
|
2018-03-06 14:28:25 +03:00
|
|
|
{% if cookiecutter.use_celery == 'y' -%}
|
2015-04-26 08:08:23 +03:00
|
|
|
|
2018-03-06 14:28:25 +03:00
|
|
|
# Celery
|
2015-04-25 16:05:33 +03:00
|
|
|
# ------------------------------------------------------------------------------
|
2019-03-02 16:51:30 +03:00
|
|
|
{% if cookiecutter.use_docker == 'n' -%}
|
2018-06-21 22:38:48 +03:00
|
|
|
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-always-eager
|
|
|
|
CELERY_TASK_ALWAYS_EAGER = True
|
2019-03-02 16:51:30 +03:00
|
|
|
{%- endif %}
|
2018-06-21 22:38:48 +03:00
|
|
|
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-eager-propagates
|
|
|
|
CELERY_TASK_EAGER_PROPAGATES = True
|
2018-03-06 14:28:25 +03:00
|
|
|
|
|
|
|
{%- endif %}
|
|
|
|
# Your stuff...
|
2016-08-31 18:56:25 +03:00
|
|
|
# ------------------------------------------------------------------------------
|