Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store API config as Python classes instead of Python file #1

Open
alvarobartt opened this issue Apr 1, 2020 · 0 comments
Open

Store API config as Python classes instead of Python file #1

alvarobartt opened this issue Apr 1, 2020 · 0 comments
Assignees
Labels
minor-fix This issue is a proposed minor fix that may be useful

Comments

@alvarobartt
Copy link
Owner

As proposed by @gabrielmbmb, the Flask Restx configuration should be stored as Python class instances (such as the example provided below) instead of directly into a Python file so as to improve both clarity and efficiency, since it is the common standard.

class BaseConfig(object):
    DEBUG = False
    TESTING = False

class DevelopConfig(BaseConfig):
    ENV = "development"
    DEBUG = True
    PROPAGATE_EXCEPTIONS = Falseclass ProductionConfig(BaseConfig):
    ENV = "production"class TestingConfig(BaseConfig):
    ENV = "testing"
    TESTING = True
    DEBUG = True

File to modify/update can be found at: config.py

@alvarobartt alvarobartt added the minor-fix This issue is a proposed minor fix that may be useful label Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor-fix This issue is a proposed minor fix that may be useful
Projects
None yet
Development

No branches or pull requests

2 participants