title: getting html from filter and appending in django
body: <p>Hi I want to know how can I get a data from filter and append it in my html. I am getting this error <code>Uncaught SyntaxError: Unexpected token '&lt;'</code><br></p>
  <p><strong>HTML</strong></p>
  <pre><code>&lt;span id='securedata'&gt;&lt;/span&gt;
  &lt;script&gt;
          window.onscroll = () =&gt; {
              if (window.innerHeight + window.scrollY &gt;= document.body.offsetHeight) {
                  document.querySelector('body').style.background = 'purple';
                  &lt;!--my problem is --&gt;
                  $('#securedata').append(&quot;{% recommend_community_first request.user.pk %}&quot;);
  
              }
              else {
                  document.querySelector('body').style.background = 'white';
              }
          }
  
  &lt;/script&gt;
  </code></pre>
  <p>templatetags/load_recommendation.py:</p>
  <pre><code>@register.inclusion_tag('community/recommend_not_recommend.html')
  def recommend_community_first(user_id):
      user = User.objects.get(id=user_id)
      community = Community.objects.all().order_by('-popularity')[:6]
      post = Post.objects.filter(community__in=[i.pk for i in community],video__isnull=True).order_by('-created')
      return {'posts':post,'moi':user}
  </code></pre>
  <p>how can I append that data from my filter without any error. Thanks</p>