#Python #Shorts
Django view, also known as a view function or just a view, is a function in Python that returns a web response when it receives a web request. In other words, whenever a user visits a particular url that is mapped to this view, whatever is returned from the view is what the user will see. It can be a simple text, an HTML string, an image or whatever else that is allowed to be an HTTP response.
To create a view, all you need to do is to define a function in views.py within your app and make it return HttpResponse, which you can import from django.http. Note that the function inside views.py can have any name. In the next video, we will look at how to map a route to a view in a Django application.
-------------------------------------------------------------------------------------
Links:
Blog: https://evgenyurubkov.com
Twitter: / evgenyurubkov
Instagram: / evgenyurubkov
Youtube: / @codevev
Watch video What are Django Views | Python Web Development online without registration, duration hours minute second in high quality. This video was added by user codevev 22 June 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 203 once and liked it 5 people.