-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
88 lines (66 loc) · 2.23 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
TALKS_PER_PAGE = 7
COMMENTS_PER_PAGE = 20
MAX_SEARCH_RESULTS = 10
#being imported in the __init__ file:
# ADMINS, MAIL_SERVER, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD
# email server
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
MAIL_USERNAME = '[email protected]'
#MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
MAIL_PASSWORD = 'pass'
SQLALCHEMY_RECORD_QUERIES = True
# slow database query threshold (in seconds)
DATABASE_QUERY_TIMEOUT = 0.5
# administrator list
ADMINS = ['[email protected]']
def __init__(self):
pass
class DevelopmentConfig(Config):
DEBUG = True
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
MAIL_USERNAME = '[email protected]'
SECRET_KEY = os.environ.get('SECRET_KEY') or 't0p s3cr3t'
SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')
WHOOSH_BASE = os.path.join(basedir, 'search.db')
#SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
def __init__(self):
Config.__init__(self)
class TestingConfig(Config):
TESTING = True
SECRET_KEY = 'secret'
SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'data-test.sqlite')
#SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
def __init__(self):
Config.__init__(self)
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'data.sqlite')
#SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
def __init__(self):
Config.__init__(self)
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}
# administrator list
ADMINS = ['[email protected]'] #change this to your email
# -*- coding: utf-8 -*-
# ...
# available languages
LANGUAGES = {
'en': 'English',
}