How to use flask Blueprint
This article mainly explains "how to use the flask blueprint". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use flask blueprints.
First import from flask import Blueprint (written in secondary applications) 1. Create a blueprint object admin=Blueprint ('admin',name) # (written in the secondary application) 2. Operate on this blueprint object, register the route, specify a static folder, register the template filter # (written in the secondary application) @ admin.route ('/') def admin_home (): return 'admin_home' 3. Register this blueprint object on the application (written on the running master file) app.register_blueprint (admin,url_prefix='/admin')
At this point, I believe you have a deeper understanding of "the use of flask blueprints". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!