title: How to include JavaScript in a Django template?
body: <p>In my Django project 'pizzeria', I have created a static files folder for the app 'pizzas', so the folder structure is: pizzeria/pizzas/static/pizzas/. Inside this folder I have a JavaScript 'hack.js':</p>
  
  <pre><code>//hack.js
  &lt;script&gt;   
  document.getElementById("home page").innerHTML="Hacked!"
  &lt;/script&gt;
  </code></pre>
  
  <p>Now I want to include this script in my Django template (pizzeria/pizzas/templates/pizzas/base.html), however the following setup does not work (the innerHTML does not change on button click):</p>
  
  <pre><code>{% load static %}
  
  &lt;p&gt;
  &lt;a href="{% url 'pizzas:index' %}" id="home page"&gt;Home page&lt;/a&gt;
  &lt;a href="{% url 'pizzas:pizzas' %}"&gt;Our pizzas&lt;/a&gt;
  &lt;button onclick="{% static 'pizzas/hack.js' %}"&gt;Hack!&lt;/button&gt;
  &lt;/p&gt;
  
  {% block content %} {% endblock content %}
  </code></pre>
  
  <p>What am I doing wrong?</p>