![]() ![]() To check that open your terminal and run this command python app.py, then go to your browser and see that This is flask blueprint example is printed. from views import index_blueprintĪpp.register_blueprint is the method we used here to register the blueprint with the app object.Īs we have registered our blueprint with the application, it’s time to check if our blueprint is actually working. The following code base shows how to register index_blueprint with app object in app.py file. Now that we have our blueprint object, we need to register it with app object. And then we have passed _name_ as the second argument which will be used by Flask to locate the Blueprint’s resources. While creating the index_blueprint object, first we have passed the name of the blueprint that will be used in Flask’s routing mechanism.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |