# Need Help With View Query Comparing Dates

**URL:** <https://forum.djangoproject.com/t/need-help-with-view-query-comparing-dates/3116>\
**Category:** Using Django\
**Created:** [June 24, 2020, 6:19pm UTC](https://forum.djangoproject.com/t/need-help-with-view-query-comparing-dates/3116 "2020-06-24T18:19:13Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 25, 2020, 3:19pm UTC](https://forum.djangoproject.com/t/need-help-with-view-query-comparing-dates/3116/12 "2020-06-25T15:19:49Z")

</div>

Not quite - I’m getting the impression from this that you’re looking at this from the wrong angle.

Briefly:

- Browser issues HTTP GET on a url
- Django receives the request, and looks for a matching url.
- When it finds the URL, it then calls the view for that url.
- The view does whatever processing needs to be done and returns a result.
  - The returned result _might_ be a web page
    - It could also be a fragment of a page to be inserted into the current page as a result of an AJAX call
    - It could be JSON data returned to an AJAX call
    - It could be an HTTP error status such as a 404 or 500

The key point here is to **not** look at the templates as a “page”. (It _might_ be one, but it may not.) It’s what the view returns as the result of a request.

The purpose of the built-in render function is to convert a template into HTML, to be returned by the view.

Another key point then is that you’re not limited to only rendering one template per page. As long as what you’re returning is a proper response for the request, you can render multiple templates in your view.

Ken

---

_[View the full topic](https://forum.djangoproject.com/t/need-help-with-view-query-comparing-dates/3116)._
