Blame view

flaskr/settings.py 1.03 KB
b68964fe   Goutte   Add the initial s...
1
import tempfile
76e12c62   Antoine Goutenoir   Continue tackling...
2
3
4
5
6
7
8


# Configuration should be done in .env file
# Create it first:
#     cp .env.dist .env
# And then edit it with your own sauce.
# The contents of .env will override values in here.
b68964fe   Goutte   Add the initial s...
9
10
11


class Config(object):
76e12c62   Antoine Goutenoir   Continue tackling...
12
    FLASK_RUN_EXTRA_FILES="content.yml"
b68964fe   Goutte   Add the initial s...
13
14
15
16


class ProductionConfig(Config):
    ENV = 'production'
76e12c62   Antoine Goutenoir   Continue tackling...
17

96ddf8ec   Antoine Goutenoir   Add the productio...
18
    SQLALCHEMY_DATABASE_URI = 'sqlite:///../database_prod.db'
b68964fe   Goutte   Add the initial s...
19
20
21
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    CACHE_TYPE = 'simple'
b68964fe   Goutte   Add the initial s...
22
23
24
25
26
27
28
29
30
31
32
33
34
35


class DevelopmentConfig(Config):
    ENV = 'development'
    DEBUG = True
    DEBUG_TB_INTERCEPT_REDIRECTS = False

    SQLALCHEMY_DATABASE_URI = 'sqlite:///../database.db'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    CACHE_TYPE = 'null'
    ASSETS_DEBUG = True


76e12c62   Antoine Goutenoir   Continue tackling...
36
37
38
db_file = tempfile.NamedTemporaryFile()


b68964fe   Goutte   Add the initial s...
39
40
41
42
43
class TestConfig(Config):
    ENV = 'test'
    DEBUG = True
    DEBUG_TB_INTERCEPT_REDIRECTS = False

76e12c62   Antoine Goutenoir   Continue tackling...
44
    SQLALCHEMY_DATABASE_URI = 'sqlite:///../%s' % db_file.name
b68964fe   Goutte   Add the initial s...
45
46
47
48
49
    SQLALCHEMY_ECHO = True
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    CACHE_TYPE = 'null'
    WTF_CSRF_ENABLED = False