代码拉取完成,页面将自动刷新
# pylint: disable=too-few-public-methods,invalid-name,missing-docstring
import os
class BaseConfig(object):
SECRET_KEY = 'this-really-needs-to-be-changed'
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
# POSTGRESQL
# DB_USER = 'user'
# DB_PASSWORD = 'password'
# DB_NAME = 'restplusdb'
# DB_HOST = 'localhost'
# DB_PORT = 5432
# SQLALCHEMY_DATABASE_URI = 'postgresql://{user}:{password}@{host}:{port}/{name}'.format(
# user=DB_USER,
# password=DB_PASSWORD,
# host=DB_HOST,
# port=DB_PORT,
# name=DB_NAME,
# )
# SQLITE
SQLALCHEMY_DATABASE_URI = 'sqlite:///%s' % (os.path.join(PROJECT_ROOT, "example.db"))
DEBUG = False
ERROR_404_HELP = False
REVERSE_PROXY_SETUP = os.getenv('EXAMPLE_API_REVERSE_PROXY_SETUP', False)
AUTHORIZATIONS = {
'oauth2_password': {
'type': 'oauth2',
'flow': 'password',
'scopes': {},
'tokenUrl': '/auth/oauth2/token',
},
# TODO: implement other grant types for third-party apps
#'oauth2_implicit': {
# 'type': 'oauth2',
# 'flow': 'implicit',
# 'scopes': {},
# 'authorizationUrl': '/auth/oauth2/authorize',
#},
}
ENABLED_MODULES = (
'auth',
'users',
'teams',
'api',
)
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
SWAGGER_UI_JSONEDITOR = True
SWAGGER_UI_OAUTH_CLIENT_ID = 'documentation'
SWAGGER_UI_OAUTH_REALM = "Authentication for Flask-RESTplus Example server documentation"
SWAGGER_UI_OAUTH_APP_NAME = "Flask-RESTplus Example server documentation"
# TODO: consider if these are relevant for this project
SQLALCHEMY_TRACK_MODIFICATIONS = True
CSRF_ENABLED = True
class ProductionConfig(BaseConfig):
SECRET_KEY = os.getenv('EXAMPLE_API_SERVER_SECRET_KEY')
SQLALCHEMY_DATABASE_URI = os.getenv('EXAMPLE_API_SERVER_SQLALCHEMY_DATABASE_URI')
class DevelopmentConfig(BaseConfig):
DEBUG = True
class TestingConfig(BaseConfig):
TESTING = True
# Use in-memory SQLite database for testing
SQLALCHEMY_DATABASE_URI = 'sqlite://'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。