Module 07 ยท Django Anatomy โ Lesson 2 of 3 ยท ~8 min
URLs & views
A view is request โ response, same as Flask
Strip away the file spray and Django's core idea is identical to Flask's: a Python function takes a request and returns a response. Django calls that function a view, and it lives in walks/views.py instead of decorated inline in app.py.
The difference is registration. Flask decorates the function directly: @app.route("/walkers"). Django keeps views and routing in two separate files โ the view is just a plain function, and a separate urls.py maps a path to it.