4
Working with Views
With any web application, it is very important to control how you interact with web requests and the proper responses to cater to these requests. This chapter takes us through the various methods of handling requests properly and designing them in the best way.
Flask offers several ways of designing and laying out URL routing for our applications. Also, it gives us the flexibility to keep the architecture of our views as just functions or to create classes, which can be inherited and modified as required. In earlier versions, Flask just had function-based views. Later, however, in Version 0.7, inspired by Django, Flask introduced the concept of pluggable views, which allows us to have classes and then write methods in these ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access