regluit/settings/prod.py

138 lines
3.8 KiB
Python
Raw Normal View History

2016-12-28 04:37:11 +00:00
from .common import *
2011-10-07 03:14:29 +00:00
ALLOWED_HOSTS = ['.unglue.it']
2011-11-17 23:05:01 +00:00
DEBUG = False
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
# we are launched!
2012-10-15 15:08:06 +00:00
IS_PREVIEW = False
2011-10-07 03:14:29 +00:00
2012-01-15 23:24:09 +00:00
SITE_ID = 1
2011-10-07 03:14:29 +00:00
ADMINS = (
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
2011-10-07 03:14:29 +00:00
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
2012-01-15 20:37:08 +00:00
'NAME': 'unglueit',
2016-12-21 19:36:06 +00:00
'USER': DATABASE_USER,
'PASSWORD': DATABASE_PASSWORD,
'HOST': DATABASE_HOST,
2011-10-07 03:14:29 +00:00
'PORT': '',
2018-04-20 01:19:40 +00:00
'TEST': {
'CHARSET': 'utf8',
}
2011-10-07 03:14:29 +00:00
}
}
TIME_ZONE = 'America/New_York'
2016-12-20 19:43:16 +00:00
# settings for outbout email
# if you have a gmail account you can use your email address and password
# Amazon SES
2012-06-23 00:13:24 +00:00
EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'
MAIL_USE_TLS = True
EMAIL_HOST = 'email-smtp.us-east-1.amazonaws.com'
EMAIL_PORT = 465
DEFAULT_FROM_EMAIL = 'notices@gluejar.com'
2011-10-07 03:14:29 +00:00
# send celery log to Python logging
CELERYD_HIJACK_ROOT_LOGGER = False
# Next step to try https
#BASE_URL = 'http://unglue.it'
2012-05-16 00:42:16 +00:00
BASE_URL_SECURE = 'https://unglue.it'
IPN_SECURE_URL = False
# use redis for production queue
BROKER_TRANSPORT = "redis"
BROKER_HOST = "localhost"
BROKER_PORT = 6379
BROKER_VHOST = "0"
2011-11-17 23:05:01 +00:00
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
2016-06-24 21:39:37 +00:00
'formatters': {
'brief': {
'format': '%(asctime)s %(levelname)s %(name)s[%(funcName)s]: %(message)s',
},
},
2011-11-17 23:05:01 +00:00
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
},
2016-05-11 13:08:04 +00:00
'null': {
'level': 'DEBUG',
'class': 'logging.NullHandler',
},
2016-06-24 21:39:37 +00:00
'file': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': join('/var/log/regluit', 'unglue.it.log'),
'maxBytes': 1024*1024*5, # 5 MB
'backupCount': 5,
'formatter': 'brief',
},
2011-11-17 23:05:01 +00:00
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
2016-05-11 13:08:04 +00:00
'django.security.DisallowedHost': {
'handlers': ['null'],
'propagate': False,
},
2016-06-24 21:39:37 +00:00
'': {
'handlers': ['file'],
'level': 'WARNING',
'propagate': False,
},
2011-11-17 23:05:01 +00:00
}
}
STATIC_ROOT = '/var/www/static'
#CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
#CKEDITOR_UPLOAD_PREFIX = 'https://unglue.it/static/media/'
# decide which of the period tasks to add to the schedule
CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
# update the statuses of campaigns
CELERYBEAT_SCHEDULE['update_active_campaign_statuses'] = UPDATE_ACTIVE_CAMPAIGN_STATUSES
CELERYBEAT_SCHEDULE['report_new_ebooks'] = EBOOK_NOTIFICATIONS_JOB
2012-11-21 16:09:18 +00:00
CELERYBEAT_SCHEDULE['notify_ending_soon'] = NOTIFY_ENDING_SOON_JOB
CELERYBEAT_SCHEDULE['update_account_statuses'] = UPDATE_ACCOUNT_STATUSES
CELERYBEAT_SCHEDULE['notify_expiring_accounts'] = NOTIFY_EXPIRING_ACCOUNTS
CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB
2015-01-23 18:11:19 +00:00
CELERYBEAT_SCHEDULE['refresh_acqs'] = NOTIFY_UNCLAIMED_GIFTS
# set -- sandbox or production Amazon FPS?
#AMAZON_FPS_HOST = "fps.sandbox.amazonaws.com"
AMAZON_FPS_HOST = "fps.amazonaws.com"
# local settings for maintenance mode
2016-09-09 01:55:39 +00:00
MAINTENANCE_MODE = False
2013-02-11 18:47:03 +00:00
# Amazon keys to permit S3 access
# https://console.aws.amazon.com/iam/home?region=us-east-1#/users/s3user?section=security_credentials
2013-02-11 18:47:03 +00:00
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
2013-03-30 16:47:45 +00:00
# we should suppress Google Analytics outside of production
SHOW_GOOGLE_ANALYTICS = True
2016-12-28 04:37:11 +00:00
# if settings/local.py exists, import those settings -- allows for dynamic generation of parameters such as DATABASES
try:
from regluit.settings.local import *
except ImportError:
pass