<filename>config.py<gh_stars>1-10
import os

basedir = os.path.abspath(os.path.dirname(__file__))


class Config:
    SECRET_KEY = '<KEY>'
    # MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.googlemail.com')
    # MAIL_PORT = int(os.environ.get('MAIL_PORT', '587'))
    # MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS', 'true').lower() in \
    #     ['true', 'on', '1']
    # MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    # MAIL_PASSWORD = os.<PASSWORD>.get('MAIL_PASSWORD')
    # FLASKY_MAIL_SUBJECT_PREFIX = '[Flasky]'
    # FLASKY_MAIL_SENDER = 'Flasky Admin <<EMAIL>>'
    FLASKY_ADMIN = os.environ.get('FLASKY_ADMIN') or 'admin'
    FLASKY_PWD = os.environ.get('FLASKY_PWD') or '<PASSWORD>'
    # SSL_REDIRECT = False
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SALT = 'your salt'
    # SQLALCHEMY_RECORD_QUERIES = True
    # FLASKY_POSTS_PER_PAGE = 20
    # FLASKY_FOLLOWERS_PER_PAGE = 50
    # FLASKY_COMMENTS_PER_PAGE = 30
    # FLASKY_SLOW_DB_QUERY_TIME = 0.5

    @staticmethod
    def init_app(app):
        pass


class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost/tsure'


class TestingConfig(Config):
    TESTING = True
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost/test_tsure'
    WTF_CSRF_ENABLED = False


config = {
    'default': DevelopmentConfig,
    'testing': TestingConfig,
}

<filename>config.py<gh_stars>1-10
import os

basedir = os.path.abspath(os.path.dirname(__file__))


class Config:
    SECRET_KEY = '<KEY>'
    # MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.googlemail.com')
    # MAIL_PORT = int(os.environ.get('MAIL_PORT', '587'))
    # MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS', 'true').lower() in \
    #     ['true', 'on', '1']
    # MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    # MAIL_PASSWORD = os.<PASSWORD>.get('MAIL_PASSWORD')
    # FLASKY_MAIL_SUBJECT_PREFIX = '[Flasky]'
    # FLASKY_MAIL_SENDER = 'Flasky Admin <<EMAIL>>'
    FLASKY_ADMIN = os.environ.get('FLASKY_ADMIN') or 'admin'
    FLASKY_PWD = os.environ.get('FLASKY_PWD') or '<PASSWORD>'
    # SSL_REDIRECT = False
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SALT = 'your salt'
    # SQLALCHEMY_RECORD_QUERIES = True
    # FLASKY_POSTS_PER_PAGE = 20
    # FLASKY_FOLLOWERS_PER_PAGE = 50
    # FLASKY_COMMENTS_PER_PAGE = 30
    # FLASKY_SLOW_DB_QUERY_TIME = 0.5

    @staticmethod
    def init_app(app):
        pass


class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost/tsure'


class TestingConfig(Config):
    TESTING = True
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost/test_tsure'
    WTF_CSRF_ENABLED = False


config = {
    'default': DevelopmentConfig,
    'testing': TestingConfig,
}

# MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.googlemail.com') # MAIL_PORT = int(os.environ.get('MAIL_PORT', '587')) # MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS', 'true').lower() in \ #     ['true', 'on', '1'] # MAIL_USERNAME = os.environ.get('MAIL_USERNAME') # MAIL_PASSWORD = os.<PASSWORD>.get('MAIL_PASSWORD') # FLASKY_MAIL_SUBJECT_PREFIX = '[Flasky]' # FLASKY_MAIL_SENDER = 'Flasky Admin <<EMAIL>>' # SSL_REDIRECT = False # SQLALCHEMY_RECORD_QUERIES = True # FLASKY_POSTS_PER_PAGE = 20 # FLASKY_FOLLOWERS_PER_PAGE = 50 # FLASKY_COMMENTS_PER_PAGE = 30 # FLASKY_SLOW_DB_QUERY_TIME = 0.5