mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-05 04:30:16 +03:00
Added trailing slashes
- trailing slashes - minor cleanups
This commit is contained in:
parent
ef0d23e590
commit
f012b69700
|
@ -50,8 +50,8 @@ CACHES = {
|
||||||
|
|
||||||
# django-debug-toolbar
|
# django-debug-toolbar
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware']
|
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ]
|
||||||
INSTALLED_APPS += ['debug_toolbar']
|
INSTALLED_APPS += ['debug_toolbar', ]
|
||||||
|
|
||||||
INTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ]
|
INTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ]
|
||||||
# tricks to have debug toolbar when developing with docker
|
# tricks to have debug toolbar when developing with docker
|
||||||
|
@ -68,7 +68,7 @@ DEBUG_TOOLBAR_CONFIG = {
|
||||||
|
|
||||||
# django-extensions
|
# django-extensions
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
INSTALLED_APPS += ['django_extensions']
|
INSTALLED_APPS += ['django_extensions', ]
|
||||||
|
|
||||||
# TESTING
|
# TESTING
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -36,12 +36,12 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
{%- if cookiecutter.use_sentry_for_error_reporting == 'y' %}
|
{%- if cookiecutter.use_sentry_for_error_reporting == 'y' %}
|
||||||
# raven sentry client
|
# raven sentry client
|
||||||
# See https://docs.sentry.io/clients/python/integrations/django/
|
# See https://docs.sentry.io/clients/python/integrations/django/
|
||||||
INSTALLED_APPS += ['raven.contrib.django.raven_compat']
|
INSTALLED_APPS += ['raven.contrib.django.raven_compat', ]
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||||
# Use Whitenoise to serve static files
|
# Use Whitenoise to serve static files
|
||||||
# See: https://whitenoise.readthedocs.io/
|
# See: https://whitenoise.readthedocs.io/
|
||||||
WHITENOISE_MIDDLEWARE = ['whitenoise.middleware.WhiteNoiseMiddleware']
|
WHITENOISE_MIDDLEWARE = ['whitenoise.middleware.WhiteNoiseMiddleware', ]
|
||||||
MIDDLEWARE = WHITENOISE_MIDDLEWARE + MIDDLEWARE
|
MIDDLEWARE = WHITENOISE_MIDDLEWARE + MIDDLEWARE
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- if cookiecutter.use_sentry_for_error_reporting == 'y' -%}
|
{%- if cookiecutter.use_sentry_for_error_reporting == 'y' -%}
|
||||||
|
@ -51,13 +51,13 @@ MIDDLEWARE = RAVEN_MIDDLEWARE + MIDDLEWARE
|
||||||
{%- if cookiecutter.use_opbeat == 'y' -%}
|
{%- if cookiecutter.use_opbeat == 'y' -%}
|
||||||
# opbeat integration
|
# opbeat integration
|
||||||
# See https://opbeat.com/languages/django/
|
# See https://opbeat.com/languages/django/
|
||||||
INSTALLED_APPS += ['opbeat.contrib.django']
|
INSTALLED_APPS += ['opbeat.contrib.django', ]
|
||||||
OPBEAT = {
|
OPBEAT = {
|
||||||
'ORGANIZATION_ID': env('DJANGO_OPBEAT_ORGANIZATION_ID'),
|
'ORGANIZATION_ID': env('DJANGO_OPBEAT_ORGANIZATION_ID'),
|
||||||
'APP_ID': env('DJANGO_OPBEAT_APP_ID'),
|
'APP_ID': env('DJANGO_OPBEAT_APP_ID'),
|
||||||
'SECRET_TOKEN': env('DJANGO_OPBEAT_SECRET_TOKEN')
|
'SECRET_TOKEN': env('DJANGO_OPBEAT_SECRET_TOKEN')
|
||||||
}
|
}
|
||||||
MIDDLEWARE = ['opbeat.contrib.django.middleware.OpbeatAPMMiddleware'] + MIDDLEWARE
|
MIDDLEWARE = ['opbeat.contrib.django.middleware.OpbeatAPMMiddleware', ] + MIDDLEWARE
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# SECURITY CONFIGURATION
|
# SECURITY CONFIGURATION
|
||||||
|
@ -83,10 +83,10 @@ X_FRAME_OPTIONS = 'DENY'
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Hosts/domain names that are valid for this site
|
# Hosts/domain names that are valid for this site
|
||||||
# See https://docs.djangoproject.com/en/1.6/ref/settings/#allowed-hosts
|
# See https://docs.djangoproject.com/en/1.6/ref/settings/#allowed-hosts
|
||||||
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['{{cookiecutter.domain_name}}'])
|
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['{{cookiecutter.domain_name}}', ])
|
||||||
# END SITE CONFIGURATION
|
# END SITE CONFIGURATION
|
||||||
|
|
||||||
INSTALLED_APPS += ['gunicorn']
|
INSTALLED_APPS += ['gunicorn', ]
|
||||||
|
|
||||||
|
|
||||||
# STORAGE CONFIGURATION
|
# STORAGE CONFIGURATION
|
||||||
|
@ -94,7 +94,7 @@ INSTALLED_APPS += ['gunicorn']
|
||||||
# Uploaded Media Files
|
# Uploaded Media Files
|
||||||
# ------------------------
|
# ------------------------
|
||||||
# See: http://django-storages.readthedocs.io/en/latest/index.html
|
# See: http://django-storages.readthedocs.io/en/latest/index.html
|
||||||
INSTALLED_APPS += ['storages']
|
INSTALLED_APPS += ['storages', ]
|
||||||
|
|
||||||
AWS_ACCESS_KEY_ID = env('DJANGO_AWS_ACCESS_KEY_ID')
|
AWS_ACCESS_KEY_ID = env('DJANGO_AWS_ACCESS_KEY_ID')
|
||||||
AWS_SECRET_ACCESS_KEY = env('DJANGO_AWS_SECRET_ACCESS_KEY')
|
AWS_SECRET_ACCESS_KEY = env('DJANGO_AWS_SECRET_ACCESS_KEY')
|
||||||
|
@ -139,7 +139,7 @@ STATICFILES_STORAGE = 'config.settings.production.StaticRootS3BotoStorage'
|
||||||
# For Django 1.7+, 'collectfast' should come before
|
# For Django 1.7+, 'collectfast' should come before
|
||||||
# 'django.contrib.staticfiles'
|
# 'django.contrib.staticfiles'
|
||||||
AWS_PRELOAD_METADATA = True
|
AWS_PRELOAD_METADATA = True
|
||||||
INSTALLED_APPS = ['collectfast'] + INSTALLED_APPS
|
INSTALLED_APPS = ['collectfast', ] + INSTALLED_APPS
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if cookiecutter.use_compressor == 'y'-%}
|
{% if cookiecutter.use_compressor == 'y'-%}
|
||||||
# COMPRESSOR
|
# COMPRESSOR
|
||||||
|
@ -156,7 +156,7 @@ EMAIL_SUBJECT_PREFIX = env('DJANGO_EMAIL_SUBJECT_PREFIX', default='[{{cookiecutt
|
||||||
SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL)
|
SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL)
|
||||||
|
|
||||||
# Anymail with Mailgun
|
# Anymail with Mailgun
|
||||||
INSTALLED_APPS += ['anymail']
|
INSTALLED_APPS += ['anymail', ]
|
||||||
ANYMAIL = {
|
ANYMAIL = {
|
||||||
'MAILGUN_API_KEY': env('DJANGO_MAILGUN_API_KEY'),
|
'MAILGUN_API_KEY': env('DJANGO_MAILGUN_API_KEY'),
|
||||||
'MAILGUN_SENDER_DOMAIN': env('MAILGUN_SENDER_DOMAIN')
|
'MAILGUN_SENDER_DOMAIN': env('MAILGUN_SENDER_DOMAIN')
|
||||||
|
@ -224,7 +224,7 @@ LOGGING = {
|
||||||
'disable_existing_loggers': True,
|
'disable_existing_loggers': True,
|
||||||
'root': {
|
'root': {
|
||||||
'level': 'WARNING',
|
'level': 'WARNING',
|
||||||
'handlers': ['sentry'],
|
'handlers': ['sentry', ],
|
||||||
},
|
},
|
||||||
'formatters': {
|
'formatters': {
|
||||||
'verbose': {
|
'verbose': {
|
||||||
|
@ -246,22 +246,22 @@ LOGGING = {
|
||||||
'loggers': {
|
'loggers': {
|
||||||
'django.db.backends': {
|
'django.db.backends': {
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'handlers': ['console'],
|
'handlers': ['console', ],
|
||||||
'propagate': False,
|
'propagate': False,
|
||||||
},
|
},
|
||||||
'raven': {
|
'raven': {
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
'handlers': ['console'],
|
'handlers': ['console', ],
|
||||||
'propagate': False,
|
'propagate': False,
|
||||||
},
|
},
|
||||||
'sentry.errors': {
|
'sentry.errors': {
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
'handlers': ['console'],
|
'handlers': ['console', ],
|
||||||
'propagate': False,
|
'propagate': False,
|
||||||
},
|
},
|
||||||
'django.security.DisallowedHost': {
|
'django.security.DisallowedHost': {
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'handlers': ['console', 'sentry'],
|
'handlers': ['console', 'sentry', ],
|
||||||
'propagate': False,
|
'propagate': False,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -297,7 +297,7 @@ LOGGING = {
|
||||||
'handlers': {
|
'handlers': {
|
||||||
'mail_admins': {
|
'mail_admins': {
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'filters': ['require_debug_false'],
|
'filters': ['require_debug_false', ],
|
||||||
'class': 'django.utils.log.AdminEmailHandler'
|
'class': 'django.utils.log.AdminEmailHandler'
|
||||||
},
|
},
|
||||||
'console': {
|
'console': {
|
||||||
|
@ -308,13 +308,13 @@ LOGGING = {
|
||||||
},
|
},
|
||||||
'loggers': {
|
'loggers': {
|
||||||
'django.request': {
|
'django.request': {
|
||||||
'handlers': ['mail_admins'],
|
'handlers': ['mail_admins', ],
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'propagate': True
|
'propagate': True
|
||||||
},
|
},
|
||||||
'django.security.DisallowedHost': {
|
'django.security.DisallowedHost': {
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'handlers': ['console', 'mail_admins'],
|
'handlers': ['console', 'mail_admins', ],
|
||||||
'propagate': True
|
'propagate': True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,16 +47,16 @@ TEST_RUNNER = 'django.test.runner.DiscoverRunner'
|
||||||
# PASSWORD HASHING
|
# PASSWORD HASHING
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Use fast password hasher so tests run faster
|
# Use fast password hasher so tests run faster
|
||||||
PASSWORD_HASHERS = (
|
PASSWORD_HASHERS = [
|
||||||
'django.contrib.auth.hashers.MD5PasswordHasher',
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
||||||
)
|
]
|
||||||
|
|
||||||
# TEMPLATE LOADERS
|
# TEMPLATE LOADERS
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Keep templates in memory so tests run faster
|
# Keep templates in memory so tests run faster
|
||||||
TEMPLATES[0]['OPTIONS']['loaders'] = [
|
TEMPLATES[0]['OPTIONS']['loaders'] = [
|
||||||
('django.template.loaders.cached.Loader', [
|
['django.template.loaders.cached.Loader', [
|
||||||
'django.template.loaders.filesystem.Loader',
|
'django.template.loaders.filesystem.Loader',
|
||||||
'django.template.loaders.app_directories.Loader',
|
'django.template.loaders.app_directories.Loader',
|
||||||
]),
|
], ],
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user