-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
40 lines (35 loc) · 1.36 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
import os
import os.path
class BaseConfig(object):
DEBUG = False
CSRF_ENABLED = True
SECRET_KEY = 'Microblog-Dev'
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SQLALCHEMY_TRACK_MODIFICATIONS = False
POSTS_PER_PAGE = 3
HOT_POSTS_COUNT = 3
class TestConfig(BaseConfig):
DEBUG = True
CSRF_ENABLED = True
class DevelopmentConfig(BaseConfig):
DEBUG = True
class ProductionConfig(BaseConfig):
DEBUG = False
CSRF_ENABLED = True
SECRET_KEY = 'C6\x1dO\xc9\xb1\x92Vd\xc4\xc9\xb5\xe18\x97]\x85\xe1\xa9\x100G\x9f\xbf'
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
POSTS_PER_PAGE = 16
HOT_POSTS_COUNT = 6
## system env
# export APP_SETTINGS="config.DevelopmentConfig"
# heroku config:set APP_SETTINGS="config.ProductionConfig"
# heroku config:set APP_SETTINGS="config.DevelopmentConfig"
# export DATABASE_URL="sqlite:///boer-utopia.db"
# export DATABASE_URL="postgresql://localhost/boer-utopia"
# heroku config:set DATABASE_URL=postgres://zhyardeyonnuqu:1lwEnSM_Zo7IH3s4WFH56d-hwm@ec2-23-21-96-129.compute-1.amazonaws.com:5432/d8q03lruh33ml0
# heroku run python db_migrate.py
## system package
# sudo apt-get install libffi-dev python-dev
# sudo apt-get install postgresql postgresql-server-dev-9.3