-
Notifications
You must be signed in to change notification settings - Fork 16
/
config.py
60 lines (46 loc) · 1.26 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import os
### Environments ###
# Configs for env DEV or PROD should be put in '<env>_config.py'
# Default to debug and dev true, prod false. Otherwise, debug and dev false,
# prod true.
DEBUG = os.getenv('DEBUG', True)
DEV = os.getenv('DEV', DEBUG)
PROD = os.getenv('PROD', not DEV)
if PROD:
DEBUG = False
DEV = False
### Default settings ###
APP_URL = 'http://localhost:5000'
# TODO: add csrf protection to user info form
CSRF_ENABLED = True
SECRET_KEY = ''
SQLALCHEMY_DATABASE_URI = 'postgres://sxwang@localhost/kindlebox'
# Redis cache defaults.
REDIS_HOST = 'localhost'
REDIS_PORT = 6379
REDIS_PASSWORD = None
CELERY_BROKER_URL = 'amqp://guest:guest@localhost//'
CELERY_ROUTES = {'conversion.tasks.convert': {'queue': 'conversion'}}
DROPBOX_APP_KEY = ''
DROPBOX_APP_SECRET = ''
# Kindlebox emailer settings. Emailer cookie is used to register each new
# emailer with Gmail's "Send mail as" endpoint.
EMAILER_ADDRESS = ''
EMAILER_PASSWORD = ''
EMAILER_COOKIE = ''
### Environment settings overrides ###
if DEV:
try:
from dev_config import *
except ImportError:
pass
elif PROD:
try:
from prod_config import *
except ImportError:
pass
BASE_DIR = '/tmp/kindlebox'
try:
os.makedirs(BASE_DIR)
except OSError:
pass