Blueprints and Views | G-Tester
A view function is the code you write to respond to requests to your application. Flask uses patterns to match the incoming request URL to the view that should handle it. The view returns data that Flask turns into an outgoing response. Flask can also go the other direction and generate a URL to a view based on its name and arguments. A Blueprint is a way to organize a group of related views and other code. Rather than registering views and other code directly with an application, they are registered with a blueprint. Then the blueprint is registered with the application when it is available in the factory function. Flaskr will have two blueprints, one for authentication functions and one for the blog posts functions. The code for each blueprint will go in a separate module. Since the blog needs to know about authentication, you’ll write the authentication one first. This creates a Blueprint named 'auth'. Like the application object, the blueprint needs to know where it’s defined, so _
Blueprints and Views | G-Tester Skip to content Menu Return to top On this page Blueprints and Views A view function is the code you write to respond to requests to your application. Flask uses patterns to match the incoming request URL to the view that should handle it. The view returns data that Flask turns into an outgoing response. Flask can also go the other direction and generate a URL to a view based on its name and arguments. Create a Blueprint A Blueprint is a way to organize a group of related views and other code. Rather than registering views and other code directly with an app
Explore this link on the map →related reading
- Use a Flask Blueprint to Architect Your Applications – Real Pythonrealpython.com
- Organize Flask Apps with Blueprintshackersandslackers.com
- The Flask Mega-Tutorial, Part III: Web Forms - miguelgrinberg.comblog.miguelgrinberg.com
- The Flask Mega-Tutorial, Part II: Templates - miguelgrinberg.comblog.miguelgrinberg.com
- Flask Project Structure: Build a Scalable Web App – Real Pythonrealpython.com
- Flask - Full Stack Pythonfullstackpython.com
- The Flask Mega-Tutorial, Part I: Hello, World! - miguelgrinberg.comblog.miguelgrinberg.com
- OpenTechSchool – Files & Templatesopentechschool.github.io
- Build a Simple CRUD App with Python, Flask, and React | Okta Developerdeveloper.okta.com
- The Flask Mega-Tutorial, Part IV: Database - miguelgrinberg.comblog.miguelgrinberg.com
- How To Create a React + Flask Project - miguelgrinberg.comblog.miguelgrinberg.com
- Roam Research – A note taking tool for networked thought.roamresearch.com