title: How can I get values from a view in Django every time I access the home page
body: <p>I currently have the following view created in Django:</p>
  <pre><code>@login_required
  def retrieve_from_db(request):
    some_ids = get_some_data()
    context = {'some_ids': some_ids}
    return render(request, 'index.html', context)
  </code></pre>
  <p>This is my urls.py:</p>
  <pre><code>from django.urls import path
  from . import views
  
  app_name = 'blabla'
  
  urlpatterns = [
     path('', views.another_view, name='index'),
     path('', views.retrieve_from_db, name='index'),
     ...
     ...
     ...
  ]
  </code></pre>
  <p>And this is part of my <code>index.html</code></p>
  <pre><code>&lt;div&gt;
    &lt;select name=&quot;myIdList&quot; id=&quot;myIdList&quot;&gt;
    {% for some_id in some_ids %}
        &lt;option value=&quot;{{ some_id }}&quot;&gt;{{ some_id }}&lt;/option&gt;
    {% endfor %}
    &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I would like to know how can I get the results from the function <code>retrieve_from_db()</code>. What I want is that every time I access the home page, by default the selects are populated with the result of the view.</p>
  <p>All I have found so far on StackOverflow have been answers using forms in which the user somehow has to perform some action to trigger the POST, is there any way to do all of this without the user having to press any buttons or perform an action? simply every time the page loads, get the results of the <code>retrieve_from_db()</code> function defined in the view.</p>