O'Reilly logo

Python Requests Essentials by Bala Subrahmanyam Varanasi, Rakesh Vidya Chandra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Views

A view is a Python function, which receives a web request and sends back a web response. The response of a view can be a simple string, web page, the content of a file, or anything. Whenever a Flask application gets a request from the client, it will look for a view function to service it. The view contains the business logic which is necessary to process a request.

In the previous sections, we have created the necessary database models. Now, in this section, we will write the view functions. Let us create view for every resource we mentioned in the previous table, which throws spot light on how we are going to design the URLs. All the views should be created in the file survey/views.py.

List of all questions

This view shows all the surveys ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required