cookiecutter-django/{{cookiecutter.project_slug}}/config/settings/local.py

73 lines
2.2 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2016-04-13 00:23:00 +03:00
"""
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
2016-04-13 00:23:00 +03:00
"""
2015-04-20 15:31:55 +03:00
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Note: This key only used for development and testing.
2016-04-13 00:23:00 +03:00
SECRET_KEY = env('DJANGO_SECRET_KEY', default='CHANGEME!!!')
# Mail settings
# ------------------------------------------------------------------------------
2016-04-11 00:18:38 +03:00
EMAIL_PORT = 1025
2016-04-11 00:18:38 +03:00
{% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' %}
2016-04-11 01:33:14 +03:00
EMAIL_HOST = env("EMAIL_HOST", default='mailhog')
2016-04-11 00:18:38 +03:00
{% else %}
EMAIL_HOST = 'localhost'
2015-07-16 07:21:06 +03:00
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND',
default='django.core.mail.backends.console.EmailBackend')
2016-04-11 00:18:38 +03:00
{% endif %}
# CACHING
# ------------------------------------------------------------------------------
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': ''
}
}
# django-debug-toolbar
# ------------------------------------------------------------------------------
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INSTALLED_APPS += ('debug_toolbar', )
INTERNAL_IPS = ('127.0.0.1', '10.0.2.2',)
DEBUG_TOOLBAR_CONFIG = {
'DISABLE_PANELS': [
'debug_toolbar.panels.redirects.RedirectsPanel',
],
'SHOW_TEMPLATE_CONTEXT': True,
}
# django-extensions
# ------------------------------------------------------------------------------
INSTALLED_APPS += ('django_extensions', )
# TESTING
# ------------------------------------------------------------------------------
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
2016-04-13 00:23:00 +03:00
{% if cookiecutter.use_celery == 'y' %}
########## CELERY
# In development, all tasks will be executed locally by blocking until the task returns
CELERY_ALWAYS_EAGER = True
########## END CELERY
{% endif %}
# Your local stuff: Below this line define 3rd party library settings