Blame view

flaskr/settings.py 957 Bytes
b68964fe   Goutte   Add the initial s...
1
2
3
4
5
6
7
8
9
10
11
import tempfile
db_file = tempfile.NamedTemporaryFile()


class Config(object):
    SECRET_KEY = 'TWOOXYGENONECARBON'
    # FLASK_RUN_EXTRA_FILES="content.yml"


class ProductionConfig(Config):
    ENV = 'production'
96ddf8ec   Antoine Goutenoir   Add the productio...
12
    SQLALCHEMY_DATABASE_URI = 'sqlite:///../database_prod.db'
b68964fe   Goutte   Add the initial s...
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
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    CACHE_TYPE = 'simple'
    SECRET_KEY = 'REPLACE M3'  # todo: use a .env file


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


class TestConfig(Config):
    ENV = 'test'
    DEBUG = True
    DEBUG_TB_INTERCEPT_REDIRECTS = False

    SQLALCHEMY_DATABASE_URI = 'sqlite:///' + db_file.name
    SQLALCHEMY_ECHO = True
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    CACHE_TYPE = 'null'
    WTF_CSRF_ENABLED = False