Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use flask Blueprint

Shulou Source: shulou.com Published: 2022-06-02 08:03:03 10月04日 Update

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!

Tags: Blueprints methods applications usage objects content files learning practical deeper interest practicality practical easy to operate folders more friends templates websites routing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MySQL Shulou Technology Redmi Microsoft