Here is what I use to instantiate the quest app in factory:
from quart import Quart
def create_app():
app = Quart(__name__)
return app
app = create_app()
if __name__ == "__main__":
app.run(host='0.0.0.0')
When I do this I receive error like this
File "/home/anton/.pyenv/versions/3.9.17/envs/uploader_venv/lib/python3.9/site-packages/flask/sansio/app.py", line 641, in add_url_rule
if "OPTIONS" not in methods and self.config["PROVIDE_AUTOMATIC_OPTIONS"]:
KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
Expected Behavior - Quart app starts normally
Actual behavior - error on creating the app object
Proposed solution:
As you can see I don't have config object thus no config is provided. After taking a look in the app code in Quart, the line that throws the error is
if provide_automatic_options is None:
if "OPTIONS" not in methods and self.config["PROVIDE_AUTOMATIC_OPTIONS"]:
provide_automatic_options = True
required_methods.add("OPTIONS")
else:
provide_automatic_options = False
To handle the missing config object
try:
if provide_automatic_options is None:
if "OPTIONS" not in methods and self.config["PROVIDE_AUTOMATIC_OPTIONS"]:
provide_automatic_options = True
required_methods.add("OPTIONS")
else:
provide_automatic_options = False
except Exception:
provide_automatic_options = False
Environment:
Python version: 3.9.17
Quart version: 0.19.8
If I'm mistaken with anything please let me know.
Thanks
Here is what I use to instantiate the quest app in factory:
When I do this I receive error like this
Expected Behavior - Quart app starts normally
Actual behavior - error on creating the app object
Proposed solution: As you can see I don't have config object thus no config is provided. After taking a look in the app code in Quart, the line that throws the error is
To handle the missing config object
Environment:
If I'm mistaken with anything please let me know. Thanks