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 ...

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.