-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_heroku.py
57 lines (49 loc) · 1.58 KB
/
config_heroku.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
from os import environ as env
import re
# This is a config file for deploying to Heroku.
# Set these values as environment variables in your Heroku environment with:
# $ heroku config:add SOME_VAR=some_value
DEBUG = True
CSRF_ENABLED = True
SECRET_KEY = env['SECRET_KEY']
UPLOAD_FOLDER = '/tmp/'
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
# Using MongoHQ on Heroku.
# Ref: https://devcenter.heroku.com/articles/mongohq
# Visit your application on Heroku's dashboard and navigate
# to the MongoHQ dashboard. Under Admin > Users you can manage credentials.
# You don't have to set this env var, MongoHQ sets it for you.
MONGO_URL = env['MONGOHQ_URL']
mongo_re = re.compile('''
mongodb://
(?P<username>[^:]+)
:
(?P<password>[^@]+)
@
(?P<host>[^:]+)
:
(?P<port>[0-9]+)
/
(?P<db>[a-z0-9]+)
''', re.VERBOSE)
mongo = mongo_re.match(MONGO_URL)
MONGODB_SETTINGS = {
'DB': mongo.group('db'),
'USERNAME': mongo.group('username'),
'PASSWORD': mongo.group('password'),
'HOST': mongo.group('host'),
'PORT': int(mongo.group('port'))
}
AUTH_USER = env['AUTH_USER']
AUTH_PASS = env['AUTH_PASS']
MAIL_HOST = 'smtp.gmail.com'
MAIL_PORT = 587
MAIL_USER = env['MAIL_USER']
MAIL_PASS = env['MAIL_PASS']
MAIL_TARGETS = ['[email protected]']
GOOGLE_CLIENT_ID = env['GOOGLE_CLIENT_ID']
GOOGLE_CLIENT_SECRET = env['GOOGLE_CLIENT_SECRET']
GOOGLE_REDIRECT_URI = '/oauth2callback'
GITHUB_CLIENT_ID = env['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = env['GITHUB_CLIENT_SECRET']
GITHUB_REDIRECT_URI = '/github_auth'