Module flask_app.config

This module has configurations for flask app.

Source code
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""This module has configurations for flask app."""

import logging
import os
from datetime import timedelta
CONFIG = {
    "development": "flask_app.config.DevelopmentConfig",
    "testing": "flask_app.config.TestingConfig",
    "production": "flask_app.config.ProductionConfig",
    "default": "flask_app.config.ProductionConfig"
}


class BaseConfig(object):
    """Base class for default set of configs."""


    POLLING_TIME_DELAY = 0.5
    PORT = 8080
    IP = '0.0.0.0'
    PIN_CODE = "1234"
    DEBUG = False
    TESTING = False
    SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
    SECURITY_TRACKABLE = True
    LOGGING_FORMAT = "[%(asctime)s] [%(funcName)-30s] +\
                                    [%(levelname)-6s] %(message)s"
    LOGGING_LOCATION = 'web.log'
    LOGGING_LEVEL = logging.DEBUG
    SECURITY_TOKEN_MAX_AGE = 60 * 30
    SECURITY_CONFIRMABLE = False
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    CACHE_TYPE = 'simple'
    SECURITY_PASSWORD_SALT = 'super-secret-stuff-here'
    COMPRESS_MIMETYPES = ['text/html', 'text/css', 'text/xml',
                          'application/json', 'application/javascript']

    WTF_CSRF_ENABLED = False
    COMPRESS_LEVEL = 6
    COMPRESS_MIN_SIZE = 500

    LOG_TO_CONSOLE = False
    JWT_EXPIRES = timedelta(minutes=10)


class DevelopmentConfig(BaseConfig):
    """Default set of configurations for development mode."""

    DEBUG = True
    LOG_TO_CONSOLE = True
    TESTING = False
    BASEDIR = os.path.abspath(os.path.dirname(__file__))
    SECRET_KEY = 'not-so-super-secret'
    JWT_SECRET_KEY = 'another_super_awesome_secret_stuff_yo.'


class ProductionConfig(BaseConfig):
    """Default set of configurations for prod mode."""

    DEBUG = True
    TESTING = False
    BASEDIR = os.path.abspath(os.path.dirname(__file__))

    SECRET_KEY = 'lG8-PNVN-hft6-7S2n-BAyhC-FALO-G1by-aipw'
    JWT_SECRET_KEY = '2RsKj89-DCZowzk-QwB5g3-t0wBW4Q-wticR.'


class TestingConfig(BaseConfig):
    """Default set of configurations for test mode."""

    DEBUG = True
    TESTING = True
    SECRET_KEY = '792842bc-c4df-4de1-9177-we2vgns23sd'
    JWT_SECRET_KEY = 'XhCF-W3oT-iSuP-jKmr-ETSuJ-WkYPJ-tlKAxe.'

Classes

class BaseConfig (*args, **kwargs)

Base class for default set of configs.

Source code
class BaseConfig(object):
    """Base class for default set of configs."""


    POLLING_TIME_DELAY = 0.5
    PORT = 8080
    IP = '0.0.0.0'
    PIN_CODE = "1234"
    DEBUG = False
    TESTING = False
    SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
    SECURITY_TRACKABLE = True
    LOGGING_FORMAT = "[%(asctime)s] [%(funcName)-30s] +\
                                    [%(levelname)-6s] %(message)s"
    LOGGING_LOCATION = 'web.log'
    LOGGING_LEVEL = logging.DEBUG
    SECURITY_TOKEN_MAX_AGE = 60 * 30
    SECURITY_CONFIRMABLE = False
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    CACHE_TYPE = 'simple'
    SECURITY_PASSWORD_SALT = 'super-secret-stuff-here'
    COMPRESS_MIMETYPES = ['text/html', 'text/css', 'text/xml',
                          'application/json', 'application/javascript']

    WTF_CSRF_ENABLED = False
    COMPRESS_LEVEL = 6
    COMPRESS_MIN_SIZE = 500

    LOG_TO_CONSOLE = False
    JWT_EXPIRES = timedelta(minutes=10)

Subclasses

Class variables

var CACHE_TYPE
var COMPRESS_LEVEL
var COMPRESS_MIMETYPES
var COMPRESS_MIN_SIZE
var DEBUG
var IP
var JWT_EXPIRES
var LOGGING_FORMAT
var LOGGING_LEVEL
var LOGGING_LOCATION
var LOG_TO_CONSOLE
var PIN_CODE
var POLLING_TIME_DELAY
var PORT
var SECURITY_CONFIRMABLE
var SECURITY_PASSWORD_HASH
var SECURITY_PASSWORD_SALT
var SECURITY_TOKEN_MAX_AGE
var SECURITY_TRACKABLE
var SQLALCHEMY_TRACK_MODIFICATIONS
var TESTING
var WTF_CSRF_ENABLED
class DevelopmentConfig (*args, **kwargs)

Default set of configurations for development mode.

Source code
class DevelopmentConfig(BaseConfig):
    """Default set of configurations for development mode."""

    DEBUG = True
    LOG_TO_CONSOLE = True
    TESTING = False
    BASEDIR = os.path.abspath(os.path.dirname(__file__))
    SECRET_KEY = 'not-so-super-secret'
    JWT_SECRET_KEY = 'another_super_awesome_secret_stuff_yo.'

Ancestors

Class variables

var BASEDIR
var DEBUG
var JWT_SECRET_KEY
var LOG_TO_CONSOLE
var SECRET_KEY
var TESTING
class ProductionConfig (*args, **kwargs)

Default set of configurations for prod mode.

Source code
class ProductionConfig(BaseConfig):
    """Default set of configurations for prod mode."""

    DEBUG = True
    TESTING = False
    BASEDIR = os.path.abspath(os.path.dirname(__file__))

    SECRET_KEY = 'lG8-PNVN-hft6-7S2n-BAyhC-FALO-G1by-aipw'
    JWT_SECRET_KEY = '2RsKj89-DCZowzk-QwB5g3-t0wBW4Q-wticR.'

Ancestors

Class variables

var BASEDIR
var DEBUG
var JWT_SECRET_KEY
var SECRET_KEY
var TESTING
class TestingConfig (*args, **kwargs)

Default set of configurations for test mode.

Source code
class TestingConfig(BaseConfig):
    """Default set of configurations for test mode."""

    DEBUG = True
    TESTING = True
    SECRET_KEY = '792842bc-c4df-4de1-9177-we2vgns23sd'
    JWT_SECRET_KEY = 'XhCF-W3oT-iSuP-jKmr-ETSuJ-WkYPJ-tlKAxe.'

Ancestors

Class variables

var DEBUG
var JWT_SECRET_KEY
var SECRET_KEY
var TESTING