forked from xpleaf/Blog_mini
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
25 lines (22 loc) · 1006 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
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config():
# DEBUG = True
SQLALCHEMY_TRACK_MODIFICATIONS = True
# SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'data.sqlite')
ARTICLES_PER_PAGE = 10
COMMENTS_PER_PAGE = 6
SECRET_KEY = 'secret key to protect from csrf'
WTF_CSRF_SECRET_KEY = 'random key for form' # for csrf protection
# Take good care of 'SECRET_KEY' and 'WTF_CSRF_SECRET_KEY', if you use the
# bootstrap extension to create a form, it is Ok to use 'SECRET_KEY',
# but when you use tha style like '{{ form.name.labey }}:{{ form.name() }}',
# you must do this for yourself to use the wtf, more about this, you can
# take a reference to the book <<Flask Framework Cookbook>>.
# But the book only have the version of English.
@staticmethod
def init_app(app):
pass