What does " test_config=None" mean in a flask app ? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

What does " test_config=None" mean in a flask app ?

What does " test_config=None" mean in a flask app ? I read the flask documentation but i really didn't understand Here's an example code: import os from flask import Flask def create_app(test_config=None): app = Flask (__name__) return app

19th Sep 2020, 5:12 AM
Marina Khamis
Marina Khamis  - avatar
3 Réponses
+ 3
In this example it does nothing, the function just takes that argument but doesn't use it, you can call it whatever you want. Link the part of the documentation where you read this and I'll analyze it
19th Sep 2020, 5:51 AM
Bagon
Bagon - avatar
0
Bagon Thanks for replying, I mean what does it do in general ? It's usage ? Here's the documentation https://flask.palletsprojects.com/en/1.1.x/tutorial/factory/
19th Sep 2020, 6:22 AM
Marina Khamis
Marina Khamis  - avatar
0
Marina Khamis you can load a configuration file and override some default keys, not that useful for small projects but might be handy in large ones
19th Sep 2020, 6:46 AM
Bagon
Bagon - avatar