title: Would it be a bad idea to use Django template tags to add context to a template? (Trying to imitate ease of Vue components)
body: <p>One of the problems I have with Django (at least how I've learned to use it so far) is that there's not a great way to build components like in Vue.</p>
  <p>In my templates I have been using {% include %} statements to include more modular pieces of template code/components. the problem, though, is that if I use a piece of data in the component then it needs to be passed to every single view that I use it in.</p>
  <p>For example, suppose I have this template:</p>
  <pre><code>&lt;p&gt;I'm a template!&lt;/p&gt;
  
  {% include './components/weather.html' %}
  
  </code></pre>
  <p>and then in ./components/weather.html:</p>
  <pre><code>&lt;p&gt;The weather is {{ weather.status }} today.&lt;/p&gt;
  </code></pre>
  <p>Now, in any view that I want to use weather.html in, I will need to pass in 'weather' as a context variable. It would be better if I could just include a template in another template and know that it will automatically make the database requests needed to populate the context it needs.</p>
  <p>Is there any reason I can't use a tag for this? Like instead of <code>{{ weather.status }}</code> use <code>{% weather %}</code> and then in template tags something like:</p>
  <pre><code>@register.simple_tag
  def weather():
      return weather.get_status()
  </code></pre>
  <p>Is this going to open up some vulnerability I don't see or is there a better more Django-ey way to do this?</p>