Views

Views are at the heart of the application, and in Django take the form of Python functions. They accept both GET and POST web requests, allowing for multiple actions, with various responses, to occur inside the same function. Within view functions, we design how the request is parsed, how database tables are queried, how the query results (QuerySets in Django) are processed, and which forms and templates are sent to the browser along with the processed data.

Now that the URL patterns are in place, we need to write some views that will accept and process the web requests sent to the URLs. These views will query the database table model classes in models.py to find the location data associated with each NBA arena included in the Arenas class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset