-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
45 lines (33 loc) · 983 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
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'jinming'
class Config(object):
@staticmethod
def get_database_uri(**database):
return 'postgresql://{user}:{password}@{host}:{port}/{name}'.format(
user=database['USER'],
password=database['PASSWORD'],
host=database['HOST'],
port=database['PORT'],
name=database['NAME'],
)
class Default(object):
# debug mole
DEBUG = True
# postgresql configuration
DATABASE = {
'NAME': 'testsns',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': '127.0.0.1',
'PORT': '5432',
}
SQLALCHEMY_DATABASE_URI = Config.get_database_uri(**DATABASE)
SQLALCHEMY_BINDS = {
}
# the secret key
SECRET_KEY = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
# SECRET_KEY = "secret"
# celery configuration
CELERY_BROKER_URL = 'redis://localhost:6379'
CELERY_IMPORTS = ['tasks']