import os

class BaseConfig:
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'hello world'
    ADMIN_PER_PAGE = 10
    COMMENT_PER_PAGE = POST_PER_PAGE = 5
    USER_FOLLOW = 10
    SQLALCHEMY_TRACK_MODIFICATIONS = False

class DevelopConfig(BaseConfig):
    SQLALCHEMY_DATABASE_URI = 'mysql://root@localhost/dog?charset=utf8'
    # SERVER 和 PORT 是需要网上查的，各家的邮箱都不同
    MAIL_SERVER = 'smtp.qq.com'
    MAIL_PORT = 25
    # 下面这俩通常这么设置
    # MAIL_USE_TLS = True
    # MAIL_USE_SSL = False
    # USERNAME 是发信人的邮箱，PASSWORD 是从邮箱那里获得的授权码
    MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
    
class TestConfig(BaseConfig):
    pass

configs = {
    'dev': DevelopConfig,
    'test': TestConfig
}
