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
|
|
|
|
DEBUG = env.bool('DJANGO_DEBUG', default=True)
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
|
|
|
SECRET_KEY = env('DJANGO_SECRET_KEY', default='!!!SET DJANGO_SECRET_KEY!!!')
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
2018-03-04 17:51:37 +03:00
|
|
|
ALLOWED_HOSTS = [
|
|
|
|
"localhost",
|
|
|
|
"0.0.0.0",
|
2018-03-16 19:35:39 +03:00
|
|
|
"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 = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
|
|
|
'LOCATION': ''
|
|
|
|
}
|
|
|
|
}
|
2015-04-20 00:09:00 +03:00
|
|
|
|
2018-03-06 14:28:25 +03:00
|
|
|
# TEMPLATES
|
2015-04-20 00:09:00 +03:00
|
|
|
# ------------------------------------------------------------------------------
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#templates
|
2018-03-06 19:56:27 +03:00
|
|
|
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG # noqa F405
|
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
|
2017-02-13 21:33:52 +03:00
|
|
|
EMAIL_HOST = env('EMAIL_HOST', default='mailhog')
|
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
|
2017-06-26 22:21:32 +03:00
|
|
|
EMAIL_HOST = 'localhost'
|
2018-03-06 14:28:25 +03:00
|
|
|
{%- else -%}
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
|
|
|
|
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend')
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-host
|
2016-04-11 00:18:38 +03:00
|
|
|
EMAIL_HOST = 'localhost'
|
2018-03-06 14:28:25 +03:00
|
|
|
{%- endif %}
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-port
|
|
|
|
EMAIL_PORT = 1025
|
2014-05-25 18:50:13 +04:00
|
|
|
|
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
|
2018-03-06 19:56:27 +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
|
2018-03-06 19:56:27 +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 = {
|
|
|
|
'DISABLE_PANELS': [
|
|
|
|
'debug_toolbar.panels.redirects.RedirectsPanel',
|
|
|
|
],
|
|
|
|
'SHOW_TEMPLATE_CONTEXT': True,
|
|
|
|
}
|
2018-03-06 14:28:25 +03:00
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
|
|
|
|
INTERNAL_IPS = ['127.0.0.1', '10.0.2.2']
|
|
|
|
{% if cookiecutter.use_docker == 'y' -%}
|
|
|
|
import socket
|
|
|
|
import os
|
|
|
|
if os.environ.get('USE_DOCKER') == 'yes':
|
2018-03-08 15:54:24 +03:00
|
|
|
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
|
|
|
|
INTERNAL_IPS += [ip[:-1] + '1' for ip in ips]
|
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
|
2018-03-06 19:56:27 +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
|
|
|
# ------------------------------------------------------------------------------
|
2018-03-06 14:28:25 +03:00
|
|
|
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-task_always_eager
|
2014-10-12 12:32:17 +04:00
|
|
|
CELERY_ALWAYS_EAGER = True
|
2018-03-06 14:28:25 +03:00
|
|
|
|
|
|
|
{%- endif %}
|
|
|
|
# Your stuff...
|
2016-08-31 18:56:25 +03:00
|
|
|
# ------------------------------------------------------------------------------
|