-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
67 lines (51 loc) · 1.87 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
# -*- config:utf-8 -*-
import logging
import os
from datetime import timedelta
project_name = "flask_empty"
# base config class; extend it to your needs.
class Config(object):
# use DEBUG mode?
DEBUG = False
# use TESTING mode?
TESTING = False
# use server x-sendfile?
USE_X_SENDFILE = False
# DATABASE CONFIGURATION
# see http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html#database-urls
#SQLALCHEMY_DATABASE_URI = 'sqlite:///%s/empty.sqlite3' % (os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = ""
SQLALCHEMY_ECHO = False
WTF_CSRF_ENABLED = True
SECRET_KEY = "secret" # import os; os.urandom(24)
# LOGGING
LOGGER_NAME = "%s_log" % project_name
LOG_FILENAME = "/var/tmp/app.%s.log" % project_name
LOG_LEVEL = logging.INFO
LOG_FORMAT = "%(asctime)s %(levelname)s\t: %(message)s" # used by logging.Formatter
PERMANENT_SESSION_LIFETIME = timedelta(days=7)
# EMAIL CONFIGURATION
MAIL_SERVER = "localhost"
MAIL_PORT = 25
MAIL_USE_TLS = False
MAIL_USE_SSL = False
MAIL_DEBUG = False
MAIL_USERNAME = None
MAIL_PASSWORD = None
DEFAULT_MAIL_SENDER = "example@%s.com" % project_name
# see example/ for reference
# ex: BLUEPRINTS = ['blog'] # where app is a Blueprint instance
# ex: BLUEPRINTS = [('blog', {'url_prefix': '/myblog'})] # where app is a Blueprint instance
BLUEPRINTS = []
# config class for development environment
class Dev(Config):
DEBUG = True # we want debug level output
MAIL_DEBUG = True
SQLALCHEMY_ECHO = True # we want to see sqlalchemy output
SQLALCHEMY_DATABASE_URI = "sqlite:////var/tmp/%s_dev.sqlite" % project_name
# config class used during tests
class Test(Config):
TESTING = True
WTF_CSRF_ENABLED = False
SQLALCHEMY_ECHO = False
SQLALCHEMY_DATABASE_URI = "sqlite:////tmp/%s_test.sqlite" % project_name