-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
40 lines (32 loc) · 1.27 KB
/
config.py
File metadata and controls
40 lines (32 loc) · 1.27 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
# -*- coding: utf-8 -*-
import os
# Belonging to the path of sqlite development database.
basedir = os.path.abspath(os.path.dirname(__file__))
engine = '' # sqlite, Mysql, postgres and so on.
db_name = ''
db_user = ''
db_password = ''
db_server = 'localhost' # Usually, localhost
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = '{0}://{1}:{2}@{3}/{4}'.format(engine,
db_user,
db_password,
db_server,
db_name)
DATABASE_CONNECT_OPTIONS = {}
SECRET_KEY = 'key'
CSRF_SESSION_KEY = "somethingimpossibletoguess"
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = engine + ':///' + os.path.join(basedir,
db_name)
DATABASE_CONNECT_OPTIONS = {}
sQLALCHEMY_ECHO = True
SECRET_KEY = 'This string will be replaced with a proper key in production'
CSRF_SESSION_KEY = "somethingimpossibletoguess"
class TestingConfig(Config):
TESTING = True