title: Where to store static/template files in Django according to "Two Scoops of Django"
body: <p>I'm a reader and a big fan of the popular book <a href="http://twoscoopspress.com/products/two-scoops-of-django-1-6" rel="nofollow">Two Scoops of Django</a>.
  The book is full of great ideas, but there is one which is not that clear to me.</p>
  
  <p>The authors advice to create a <code>static</code> and a <code>templates</code> folder in the Django project root.<br>
  That <code>template</code> folder is meant for "site-wide templates" (stated at pag.24).
  Plus at pag.162 they say that "templates should usually go into the root folder of the Django project... The only exception is when you bundle up an app into a third-party package".</p>
  
  <p>They don't mention it explicitly in ch.12 but I guess it is good to create a folder for each app (with the same name as the app) in the <code>templates</code> root.<br>
  Let's suppose that in my <code>icecreamratings</code> Django project I have 2 apps:</p>
  
  <ul>
  <li><code>flavors</code> with 2 templates: new_flavor.html and details.html</li>
  <li><code>profiles</code> with 1 template: details.html
  All templates inherit from <code>base.html</code>.</li>
  </ul>
  
  <p>I guess they would suggest the following structure:</p>
  
  <pre><code>icecreamratings_project/
    |-- ...
    |-- icecreamratings/  # Django project root
          |-- ...
          |-- static/
          |-- templates/
                |-- 404.html
                |-- 500.html
                |-- base.html
                |-- flavors/  # same name as app flavor
                |     |-- new_flavor.html
                |     |-- details.html
                |-- profiles/  # same name as app profiles
                      |-- details.html
  </code></pre>
  
  <p>Did I get it correctly?</p>
  
  <p>On the other hand, the <a href="https://docs.djangoproject.com/en/1.6/howto/static-files/" rel="nofollow">Django official docs</a> suggests to create a <code>static</code> folder in each app and, inside it, a subfolder with the same name as the app, like: <code>my_app/static/my_app/myimage.jpg</code>.</p>
  
  <p>So we have 2 different strategies: a unique <code>template</code> folder and many <code>static</code> folders (one in each app).
  Having two different strategies is clearly a bad choice.</p>
  
  <p>So, what do you think of storing in each app a <code>template</code> and <code>static</code> folder?
  Something like this:</p>
  
  <pre><code>icecreamratings_project/
    |-- ...
    |-- icecreamratings/  # Django project root
          |-- ...
          |-- static/  # site-wide static files
          |     |-- bootstrap/  # bootstrap source files
          |     |-- jquery/  # jquery source files
          |     |-- css/  # css files used by base.html (and others in templates root)
          |     |-- js/  # javascript files used base.html (and others in templates root)
          |     |-- img/  # img files files used base.html (and others in templates root)
          |-- templates/  # site-wide templates
          |     |-- 404.html
          |     |-- 500.html
          |     |-- base.html
          |-- flavors/  # an app
                |-- static/
                |     |-- flavors/  # static files specific for this app
                |           |-- css/  # css files for flavor app templates
                |           |-- js/  # javascript files for flavor app templates
                |           |-- img/  # img files for flavor app templates
                |-- templates/  # template files specific for this app
                      |-- new_flavor.html
                      |-- details.html
  </code></pre>