forked from fossasia/open-event-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
57 lines (42 loc) · 1.42 KB
/
config.py
File metadata and controls
57 lines (42 loc) · 1.42 KB
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
"""Written by - Rafal Kowalski"""
import os
_basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
CORS_HEADERS = 'Content-Type'
SQLALCHEMY_TRACK_MODIFICATIONS = True
ERROR_404_HELP = False
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:///../app.db')
BASE_DIR = _basedir
class ProductionConfig(Config):
DEBUG = False
MINIFY_PAGE = True
PRODUCTION = True
# you don't want production on default db
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', '')
if not SQLALCHEMY_DATABASE_URI:
print '`DATABASE_URL` either not exported or empty'
class StagingConfig(Config):
DEVELOPMENT = True
DEBUG = True
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
MINIFY_PAGE = False
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', '')
if not SQLALCHEMY_DATABASE_URI:
print '`DATABASE_URL` either not exported or empty'
class TestingConfig(Config):
TESTING = True
CELERY_ALWAYS_EAGER = True
CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
class LocalPSQLConfig(Config):
DEVELOPMENT = True
DEBUG = True
SQLALCHEMY_DATABASE_URI = "postgresql://postgres:start@localhost/test"
class LocalSQLITEConfig(Config):
DEVELOPMENT = True
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'app.db')