updated config
This commit is contained in:
parent
ab36e264c1
commit
d345791fe3
|
@ -404,6 +404,8 @@ CELERY_RESULT_SERIALIZER = 'json'
|
||||||
# django-compressor
|
# django-compressor
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
INSTALLED_APPS += ("compressor", 'sass_processor',)
|
INSTALLED_APPS += ("compressor", 'sass_processor',)
|
||||||
|
INSTALLED_APPS += ('django_extensions', )
|
||||||
|
INSTALLED_APPS += ('storages', )
|
||||||
STATICFILES_FINDERS += ("compressor.finders.CompressorFinder", )
|
STATICFILES_FINDERS += ("compressor.finders.CompressorFinder", )
|
||||||
|
|
||||||
# Location of root django.contrib.admin URL, use {% url 'admin:index' %}
|
# Location of root django.contrib.admin URL, use {% url 'admin:index' %}
|
||||||
|
|
|
@ -77,10 +77,6 @@ DEBUG_TOOLBAR_CONFIG = {
|
||||||
'SHOW_TEMPLATE_CONTEXT': True,
|
'SHOW_TEMPLATE_CONTEXT': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
# django-extensions
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
INSTALLED_APPS += ('django_extensions', )
|
|
||||||
INSTALLED_APPS += ('storages', )
|
|
||||||
|
|
||||||
# TESTING
|
# TESTING
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -99,6 +95,14 @@ CAPTCHA = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# LOGGING CONFIGURATION
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
|
||||||
|
# A sample logging configuration. The only tangible logging
|
||||||
|
# performed by this configuration is to send an email to
|
||||||
|
# the site admins on every HTTP 500 error when DEBUG=False.
|
||||||
|
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
||||||
|
# more details on how to customize your logging configuration.
|
||||||
LOGGING = {
|
LOGGING = {
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'disable_existing_loggers': False,
|
'disable_existing_loggers': False,
|
||||||
|
@ -124,33 +128,50 @@ LOGGING = {
|
||||||
'class': 'logging.StreamHandler',
|
'class': 'logging.StreamHandler',
|
||||||
'formatter': 'verbose',
|
'formatter': 'verbose',
|
||||||
},
|
},
|
||||||
|
'logfile': {
|
||||||
|
'level':'DEBUG',
|
||||||
|
'class':'logging.FileHandler',
|
||||||
|
'filename': "/tmp/django.log"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
'loggers': {
|
'loggers': {
|
||||||
'django.request': {
|
'django.request': {
|
||||||
'handlers': ['mail_admins'],
|
'handlers': ['mail_admins', 'logfile'],
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'propagate': True
|
'propagate': True
|
||||||
},
|
},
|
||||||
'django.security.DisallowedHost': {
|
'django.security.DisallowedHost': {
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'handlers': ['console', 'mail_admins'],
|
'handlers': ['logfile', 'console', 'mail_admins'],
|
||||||
'propagate': True
|
'propagate': True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Custom Admin URL, use {% url 'admin:index' %}
|
||||||
|
ADMIN_URL = env('DJANGO_ADMIN_URL', default='trustee/')
|
||||||
|
|
||||||
|
# Your production stuff: Below this line define 3rd party library settings
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
PAYMENT_PROVIDERS['gocardless']['redirect_url'] = 'http://127.0.0.1:8180'
|
PAYMENT_PROVIDERS['gocardless']['redirect_url'] = 'http://127.0.0.1:8180'
|
||||||
TEMPLATE_DEBUG = False
|
TEMPLATE_DEBUG = False
|
||||||
|
|
||||||
AWS_S3_SECURE_URLS = False
|
AWS_S3_SECURE_URLS = False
|
||||||
AWS_ACCESS_KEY_ID = env('MINIO_ACCESS_KEY')
|
AWS_ACCESS_KEY_ID = env('MINIO_ACCESS_KEY')
|
||||||
AWS_SECRET_ACCESS_KEY = env('MINIO_SECRET_KEY')
|
AWS_SECRET_ACCESS_KEY = env('MINIO_SECRET_KEY')
|
||||||
|
|
||||||
AWS_S3_ENDPOINT_URL = 'http://%s:9000' % socket.gethostbyname('bucket')
|
|
||||||
AWS_STORAGE_BUCKET_NAME = 'static'
|
AWS_STORAGE_BUCKET_NAME = 'static'
|
||||||
|
AWS_S3_ENDPOINT_URL = 'http://%s:9000' % socket.gethostbyname('bucket')
|
||||||
AWS_S3_OBJECT_PARAMETERS = {
|
AWS_S3_OBJECT_PARAMETERS = {
|
||||||
'CacheControl': 'max-age=86400',
|
'CacheControl': 'max-age=86400',
|
||||||
}
|
}
|
||||||
|
AWS_LOCATION = 'dev'
|
||||||
AWS_S3_SECURE_URLS = True
|
AWS_S3_SECURE_URLS = True
|
||||||
STATIC_URL = '%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME)
|
STATIC_URL = '%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME)
|
||||||
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
||||||
|
|
||||||
|
# COMPRESSOR
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
|
||||||
|
COMPRESS_STORAGE = STATICFILES_STORAGE
|
||||||
|
|
|
@ -108,6 +108,9 @@ EMAIL_HOST = 'smtp.gmail.com'
|
||||||
EMAIL_HOST_PASSWORD = env('EMAIL_PASSWORD')
|
EMAIL_HOST_PASSWORD = env('EMAIL_PASSWORD')
|
||||||
EMAIL_HOST_USER = env('EMAIL_USER')
|
EMAIL_HOST_USER = env('EMAIL_USER')
|
||||||
EMAIL_PORT = 587
|
EMAIL_PORT = 587
|
||||||
|
EMAIL_NOTIFY = True
|
||||||
|
|
||||||
|
MSG_PREFIX = 'MH'
|
||||||
|
|
||||||
# Anymail with Mailgun
|
# Anymail with Mailgun
|
||||||
#INSTALLED_APPS += ("anymail", )
|
#INSTALLED_APPS += ("anymail", )
|
||||||
|
@ -210,7 +213,7 @@ LOGGING = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom Admin URL, use {% url 'admin:index' %}
|
# Custom Admin URL, use {% url 'admin:index' %}
|
||||||
ADMIN_URL = env('DJANGO_ADMIN_URL', default='trustee')
|
ADMIN_URL = env('DJANGO_ADMIN_URL', default='trustee/')
|
||||||
|
|
||||||
# Your production stuff: Below this line define 3rd party library settings
|
# Your production stuff: Below this line define 3rd party library settings
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -233,5 +236,6 @@ STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
||||||
|
|
||||||
# COMPRESSOR
|
# COMPRESSOR
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
|
||||||
COMPRESS_STORAGE = STATICFILES_STORAGE
|
COMPRESS_STORAGE = STATICFILES_STORAGE
|
||||||
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
|
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
|
||||||
|
|
|
@ -17,7 +17,7 @@ from .common import * # noqa
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
||||||
# Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ
|
# Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ
|
||||||
SECRET_KEY = env('DJANGO_SECRET_KEY')
|
SECRET_KEY = env('DJANGO_SECRET_KEY')
|
||||||
SITE_ID = 2
|
|
||||||
|
|
||||||
# This ensures that Django will be able to detect a secure connection
|
# This ensures that Django will be able to detect a secure connection
|
||||||
# properly on Heroku.
|
# properly on Heroku.
|
||||||
|
@ -90,10 +90,10 @@ AWS_HEADERS = {
|
||||||
# MEDIA_URL = ''
|
# MEDIA_URL = ''
|
||||||
|
|
||||||
|
|
||||||
# COMPRESSOR
|
# Static Assets
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------
|
||||||
# COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
# STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
||||||
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
|
# STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
|
||||||
# EMAIL
|
# EMAIL
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
|
DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
|
||||||
|
@ -108,7 +108,7 @@ EMAIL_HOST = 'smtp.gmail.com'
|
||||||
EMAIL_HOST_PASSWORD = env('EMAIL_PASSWORD')
|
EMAIL_HOST_PASSWORD = env('EMAIL_PASSWORD')
|
||||||
EMAIL_HOST_USER = env('EMAIL_USER')
|
EMAIL_HOST_USER = env('EMAIL_USER')
|
||||||
EMAIL_PORT = 587
|
EMAIL_PORT = 587
|
||||||
EMAIL_NOTIFY = False
|
EMAIL_NOTIFY = True
|
||||||
|
|
||||||
MSG_PREFIX = 'MHS'
|
MSG_PREFIX = 'MHS'
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ DATABASES['default'] = env.db('DATABASE_URL')
|
||||||
# CACHING
|
# CACHING
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
REDIS_LOCATION = '{0}/{1}'.format(env('REDIS_URL', default='redis://127.0.0.1:6379'), 0)
|
REDIS_LOCATION = '{0}/{1}'.format(env('REDIS_URL', default='redis://redis:6379'), 0)
|
||||||
# Heroku URL does not pass the DB number, so we parse it in
|
# Heroku URL does not pass the DB number, so we parse it in
|
||||||
CACHES = {
|
CACHES = {
|
||||||
'default': {
|
'default': {
|
||||||
|
@ -195,7 +195,7 @@ LOGGING = {
|
||||||
'logfile': {
|
'logfile': {
|
||||||
'level':'DEBUG',
|
'level':'DEBUG',
|
||||||
'class':'logging.FileHandler',
|
'class':'logging.FileHandler',
|
||||||
'filename': "/tmp/django.log"
|
'filename': "/tmp/django.log"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'loggers': {
|
'loggers': {
|
||||||
|
@ -233,3 +233,8 @@ AWS_LOCATION = 'stage'
|
||||||
|
|
||||||
STATIC_URL = '%s/%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME, AWS_LOCATION)
|
STATIC_URL = '%s/%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME, AWS_LOCATION)
|
||||||
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
||||||
|
|
||||||
|
# COMPRESSOR
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
|
||||||
|
COMPRESS_STORAGE = STATICFILES_STORAGE
|
||||||
|
|
|
@ -17,7 +17,6 @@ import os
|
||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
|
|
||||||
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
|
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
|
||||||
# if running multiple sites in the same mod_wsgi process. To fix this, use
|
# if running multiple sites in the same mod_wsgi process. To fix this, use
|
||||||
# mod_wsgi daemon mode with each site in its own daemon process, or use
|
# mod_wsgi daemon mode with each site in its own daemon process, or use
|
||||||
|
@ -32,3 +31,7 @@ application = get_wsgi_application()
|
||||||
# Apply WSGI middleware here.
|
# Apply WSGI middleware here.
|
||||||
# from helloworld.wsgi import HelloWorldApplication
|
# from helloworld.wsgi import HelloWorldApplication
|
||||||
# application = HelloWorldApplication(application)
|
# application = HelloWorldApplication(application)
|
||||||
|
# apply Werkzeug WSGI middleware
|
||||||
|
if os.environ.setdefault('DEBUG', 'False') is True:
|
||||||
|
from werkzeug.debug import DebuggedApplication
|
||||||
|
application = DebuggedApplication(application, evalex=True)
|
||||||
|
|
Loading…
Reference in New Issue