updated config

This commit is contained in:
Oliver Marks 2018-01-30 07:25:07 +00:00
parent ab36e264c1
commit d345791fe3
5 changed files with 53 additions and 18 deletions

View File

@ -404,6 +404,8 @@ CELERY_RESULT_SERIALIZER = 'json'
# django-compressor
# ------------------------------------------------------------------------------
INSTALLED_APPS += ("compressor", 'sass_processor',)
INSTALLED_APPS += ('django_extensions', )
INSTALLED_APPS += ('storages', )
STATICFILES_FINDERS += ("compressor.finders.CompressorFinder", )
# Location of root django.contrib.admin URL, use {% url 'admin:index' %}

View File

@ -77,10 +77,6 @@ DEBUG_TOOLBAR_CONFIG = {
'SHOW_TEMPLATE_CONTEXT': True,
}
# django-extensions
# ------------------------------------------------------------------------------
INSTALLED_APPS += ('django_extensions', )
INSTALLED_APPS += ('storages', )
# 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 = {
'version': 1,
'disable_existing_loggers': False,
@ -124,33 +128,50 @@ LOGGING = {
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
'logfile': {
'level':'DEBUG',
'class':'logging.FileHandler',
'filename': "/tmp/django.log"
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'handlers': ['mail_admins', 'logfile'],
'level': 'ERROR',
'propagate': True
},
'django.security.DisallowedHost': {
'level': 'ERROR',
'handlers': ['console', 'mail_admins'],
'handlers': ['logfile', 'console', 'mail_admins'],
'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'
TEMPLATE_DEBUG = False
AWS_S3_SECURE_URLS = False
AWS_ACCESS_KEY_ID = env('MINIO_ACCESS_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_S3_ENDPOINT_URL = 'http://%s:9000' % socket.gethostbyname('bucket')
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_LOCATION = 'dev'
AWS_S3_SECURE_URLS = True
STATIC_URL = '%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME)
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
# COMPRESSOR
# ------------------------------------------------------------------------------
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
COMPRESS_STORAGE = STATICFILES_STORAGE

View File

@ -108,6 +108,9 @@ EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_PASSWORD = env('EMAIL_PASSWORD')
EMAIL_HOST_USER = env('EMAIL_USER')
EMAIL_PORT = 587
EMAIL_NOTIFY = True
MSG_PREFIX = 'MH'
# Anymail with Mailgun
#INSTALLED_APPS += ("anymail", )
@ -210,7 +213,7 @@ LOGGING = {
}
# 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
# ------------------------------------------------------------------------------
@ -233,5 +236,6 @@ STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
# COMPRESSOR
# ------------------------------------------------------------------------------
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
COMPRESS_STORAGE = STATICFILES_STORAGE
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)

View File

@ -17,7 +17,7 @@ from .common import * # noqa
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ
SECRET_KEY = env('DJANGO_SECRET_KEY')
SITE_ID = 2
# This ensures that Django will be able to detect a secure connection
# properly on Heroku.
@ -90,10 +90,10 @@ AWS_HEADERS = {
# MEDIA_URL = ''
# COMPRESSOR
# ------------------------------------------------------------------------------
# COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
# Static Assets
# ------------------------
# STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
# STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
# 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_USER = env('EMAIL_USER')
EMAIL_PORT = 587
EMAIL_NOTIFY = False
EMAIL_NOTIFY = True
MSG_PREFIX = 'MHS'
@ -139,7 +139,7 @@ DATABASES['default'] = env.db('DATABASE_URL')
# 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
CACHES = {
'default': {
@ -233,3 +233,8 @@ AWS_LOCATION = 'stage'
STATIC_URL = '%s/%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME, AWS_LOCATION)
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
# COMPRESSOR
# ------------------------------------------------------------------------------
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
COMPRESS_STORAGE = STATICFILES_STORAGE

View File

@ -17,7 +17,6 @@ import os
from django.core.wsgi import get_wsgi_application
# 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
# 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.
# from helloworld.wsgi import HelloWorldApplication
# 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)