-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py
32 lines (23 loc) · 803 Bytes
/
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
from os import environ as env
class Config:
TOKEN = env['TOKEN']
WEBHOOK_PORT = 8443 # 443, 80, 88 or 8443 (port need to be 'open')
WEBHOOK_LISTEN = '0.0.0.0'
MODEL_FILE_NAME = 'ft_freqprune_100K_20K_pq_300.bin'
NOUNS_FILE_NAME = 'freq_nouns.txt'
SQLALCHEMY_DATABASE_URI = env['DATABASE_URL']
if env['APP_CONFIG'] == 'local':
WEBHOOK_HOST = env['WEBHOOK_HOST']
DATA_PATH = 'data/'
elif env['APP_CONFIG'] == 'heroku':
WEBHOOK_HOST = 'https://intense-cove-71886.herokuapp.com'
WEBHOOK_PORT = env['PORT']
DATA_PATH = ''.join([
's3://',
env['AWS_ACCESS_KEY_ID'],
":",
env['AWS_SECRET_ACCESS_KEY'],
'@',
env['S3_BUCKET_NAME'],
'/'
])