title: Loading css and javascript files in more then one django templates without having to to re load css and js
body: <p>I apologize if this has been asked already but I have been trying for awhile and cannot figure out why when the route is changed in my django app all the css and js files that are used across the app like angular and jQuery need to be to loaded again. </p>
  
  <p>paths</p>
  
  <pre><code>mysite
     settings,py
     urls.py
     views.py
  static
     media
     static_dirs
     static_root
  templates
     home.html
     partials
         dealDetals.html
  </code></pre>
  
  <p>settings.py</p>
  
  <pre><code>TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates'),
    #BASE_DIR + "/templates/"
  )
  
  STATIC_ROOT = os.path.join(BASE_DIR, 'static', 'static_root')
  
  STATICFILES_DIRS = (
  
    os.path.join(BASE_DIR, 'static', 'static_dirs'),
  
  )
  
  MEDIA_ROOT = os.path.join(BASE_DIR, 'static', 'media')
  
  MEDIA_URL = "/media/"
  
  STATIC_URL = '/static/'
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code> urlpatterns = patterns('',
      url(r'^$', 'mySite.views.home', name='home'),
      url(r'^dealsDetails/', 'mySite.views.dealsDetails', name='dealsDetails'),
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def home(request):
    template = "home.html"
    return render(request, template, context)
  
  
  def dealsDetails(request):
      context = {}
      template = "partials/dealDetails.html"
      return render(request, template, context)
  </code></pre>
  
  <p>home.html</p>
  
  <pre><code>{% load staticfiles %}
  
  // this loads correctly and can be seen in the network tab in chrome dev tools
  &lt;script src="{% static 'js/bootstrap.min.js' %}"&gt;&lt;/script&gt;
  
  &lt;a href="/dealsDetails"&gt;deal details&lt;/a&gt;
  </code></pre>
  
  <p>once the route goes to <a href="http://127.0.0.1:8000/dealsDetails/" rel="nofollow">http://127.0.0.1:8000/dealsDetails/</a> all static files are no longer loading in the network tab in chrome dev tools. </p>
  
  <p>The question is how do I share css and js files across different templates ?</p>
  
  <p>I am able to load the js and css in one template but not more then one.</p>
  
  <p>Do I need to add the script and link tags to dealsDetails.html too ?? I hope not :(</p>