Last active
March 4, 2021 14:31
-
-
Save aprilahijriyan/e050df61102364d24050baab5788b091 to your computer and use it in GitHub Desktop.
Zemfrog configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import timedelta | |
from os import path | |
class Development(object): | |
SECRET_KEY = "Your secret key!" | |
SQLALCHEMY_DATABASE_URI = "sqlite:///" + path.join( | |
path.dirname(__file__), "db.sqlite" | |
) | |
SQLALCHEMY_TRACK_MODIFICATIONS = False | |
JWT_SECRET_KEY = "JWT secret key!" | |
JWT_ACCESS_TOKEN_EXPIRES = timedelta(days=7) | |
MAIL_PORT = 8025 | |
MAIL_DEFAULT_SENDER = "[email protected]" | |
APISPEC_TITLE = "API Docs" | |
APISPEC_SWAGGER_UI_URL = "/docs" | |
APISPEC_SECURITY_DEFINITIONS = { | |
"Bearer": { | |
"type": "oauth2", | |
"flow": "password", | |
"tokenUrl": "/auth/jwt/login", | |
} | |
} | |
APISPEC_SECURITY_PARAMS = [{"Bearer": []}] | |
DEBUG = True | |
APPS = [] | |
EXTENSIONS = [ | |
"zemfrog.extensions.sqlalchemy", | |
"zemfrog.extensions.marshmallow", | |
"zemfrog.extensions.migrate", | |
"zemfrog.extensions.jwt", | |
"zemfrog.extensions.mail", | |
"zemfrog.extensions.celery", | |
"zemfrog.extensions.apispec", | |
"zemfrog.extensions.cors" | |
] | |
COMMANDS = [ | |
"zemfrog.commands.api", | |
"zemfrog.commands.blueprint", | |
"zemfrog.commands.middleware", | |
"zemfrog.commands.command", | |
"zemfrog.commands.errorhandler", | |
"zemfrog.commands.extension", | |
"zemfrog.commands.model", | |
"zemfrog.commands.task", | |
"zemfrog.commands.user", | |
"zemfrog.commands.role", | |
"zemfrog.commands.permission", | |
"zemfrog.commands.loader", | |
"zemfrog.commands.secretkey", | |
"zemfrog.commands.context", | |
"zemfrog.commands.filter", | |
"zemfrog.commands.app" | |
] | |
BLUEPRINTS = ["auth"] | |
STATICFILES = [] | |
MIDDLEWARES = [] | |
APIS = [] | |
ERROR_HANDLERS = {422: "api_errors", 400: "api_errors"} | |
TASKS = [] | |
CONTEXT_PROCESSORS = [] | |
JINJA_FILTERS = [] | |
API_DOCS = True | |
CREATE_DB = True | |
USER_MODEL = "models.user.User" | |
ROLE_MODEL = "models.user.Role" | |
PERMISSION_MODEL = "models.user.Permission" | |
LOADERS = [ | |
"zemfrog.loaders.extension", | |
"zemfrog.loaders.staticfile", | |
"zemfrog.loaders.model", | |
"zemfrog.loaders.url", | |
"zemfrog.loaders.blueprint", | |
"zemfrog.loaders.middleware", | |
"zemfrog.loaders.api", | |
"zemfrog.loaders.error_handler", | |
"zemfrog.loaders.command", | |
"zemfrog.loaders.task", | |
"zemfrog.loaders.openapi", | |
"zemfrog.loaders.context_processor", | |
"zemfrog.loaders.jinja_filter", | |
"zemfrog.loaders.multiapp", | |
] | |
CELERY_RESULT_BACKEND = "redis://127.0.0.1:6379" | |
CELERY_BROKER_URL = CELERY_RESULT_BACKEND | |
class Production(Development): | |
DEBUG = False | |
JWT_COOKIE_SECURE = True | |
class Testing(Development): | |
TESTING = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment