title: Django's template tag inside javascript
body: <p>My app's urls.py is:</p>
  
  <pre><code>from django.urls import path
  from . import views
  
  app_name = 'javascript'
  urlpatterns = [
      path('create_table', views.create_table, name='create_table')
  </code></pre>
  
  <p>My views.py is:</p>
  
  <pre><code>def create_table(request):
      row_data = "this is row data"
      context = {'row_data': row_data}
      return render(request, 'javascript/create_table.html', context)
  </code></pre>
  
  <p>My create_table.html is:</p>
  
  <pre><code>{% load static %}
  &lt;button id="create_table"&gt;Get data&lt;/button&gt;
  &lt;div id="place_for_table"&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;script src="{% static 'javascript/scripts/create_table.js' %}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And my create_table.js is:</p>
  
  <pre><code>function create_table() {
      document.getElementById("place_for_table").innerHTML = '{{ row_data }}';
  }
  
  document.getElementById("create_table").onclick = function() {
      create_table()
  }
  </code></pre>
  
  <p>What I am trying to do is to run the create_table.js script on the click of the <code>create_table</code> button which should display "this is row data" text in <code>place for table</code> div element. </p>
  
  <p>However, what gets diplayed is just <code>{{ row_data ))</code>.</p>
  
  <p>I have read other similar questions on using Django's variables inside Javascript but as per my understanding they all suggest to do the way I did it, so I am not sure what I am doing wrong.</p>