title: Linking static files directory in Django
body: <p>I've multiple directories of static files. Each app has its own static files directory for making it modular. How can I access the static files dirs of all the apps. Initially I was putting all the static files under only one folder. Now I'm keeping the static files inside the apps and then want to access it from inside the app. How do I alter my <code>settings.py</code> file in order to access the static dirs.</p>
  
  <p>Here is my <strong>directory</strong> structure.</p>
  
  <pre><code>|-- assets                      // static folder named as 'assets'
  |   |-- css
  |   |   |-- bootstrap.css
  |   |   |-- bootstrap.min.css
  |   |   |-- bootstrap-responsive.css
  |   |   |-- bootstrap-responsive.min.css
  |   |   `-- login.css
  |   |-- img
  |   |   |-- glyphicons-halflings.png
  |   |   `-- glyphicons-halflings-white.png
  |   `-- js
  |       |-- bootstrap.js
  |       |-- bootstrap.min.js
  |       `-- jquery-1.9.1.min.js
  
  |-- initial                    // My Project Name
  |   |-- __init__.py
  |   |-- __init__.pyc
  |   |-- settings.py
  |   |-- settings.pyc
  |   |-- urls.py
  |   |-- urls.pyc
  |   |-- wsgi.py
  |   `-- wsgi.pyc
  |-- manage.py
  |-- models.py
  |-- modules                   //apps folder named as 'modules'
  |   |-- dashboard
  |   |   |-- __init__.py
  |   |   |-- __init__.pyc
  |   |   |-- models.py
  |   |   |-- models.pyc
  |   |   |-- static            // static folder inside the dashboard app.
  |   |   |   |-- css
  |   |   |   |-- img
  |   |   |   `-- js
  |   |   |       `-- dashboard.js
  |   |   |-- templates            // template folder inside the dashboard app.
  |   |   |   `-- dashboard
  |   |   |       `-- dashboard.html
  |   |   |-- tests.py
  |   |   |-- urls.py
  |   |   |-- urls.pyc
  |   |   |-- views.py
  |   |   `-- views.pyc
  |   |-- login            // login app
  |   |   |-- forms.py
  |   |   |-- forms.pyc
  |   |   |-- __init__.py
  |   |   |-- __init__.pyc
  |   |   |-- models.py
  |   |   |-- models.pyc
  |   |   |-- static
  |   |   |   |-- css
  |   |   |   |   `-- login.css
  |   |   |   |-- img
  |   |   |   `-- js
  |   |   |-- templates
  |   |   |   |-- auth
  |   |   |   |   |-- login.html
  |   |   |   |   |-- logout.html
  |   |   |   |   `-- register.html
  |   |   |   `-- registration
  |   |   |       `-- login.html
  |   |   |-- tests.py
  |   |   |-- urls.py
  |   |   |-- urls.pyc
  |   |   |-- views.py
  |   |   `-- views.pyc
  |  
  `-- templates              // templates folder for base templates.
      |-- base1.html
      |-- base2.html
      `-- registration
          `-- login.html
  </code></pre>
  
  <p>Here is my <strong>settings.py</strong> file, when all the static files were under one folder.</p>
  
  <pre><code>MEDIA_ROOT = os.path.normpath( os.path.join(os.path.dirname(__file__), '../assets/'))
  
  MEDIA_URL = ''
  
  STATIC_ROOT = ''
  
  STATIC_URL = '/assets/'
  </code></pre>
  
  <p>Here is my <strong>settings.py</strong> file, when all the static files were under their respective  modules/apps.</p>
  
  <pre><code>MEDIA_ROOT = (
      os.path.normpath( os.path.join(os.path.dirname(__file__), '../assets/')),
      os.path.normpath( os.path.join(os.path.dirname(__file__), '../modules/dashboard/static/')),
      os.path.normpath( os.path.join(os.path.dirname(__file__), '../modules/login/static/')),
      )
  
  MEDIA_URL = ''
  
  STATIC_ROOT = ''
  
  STATIC_URL = '/assets/'
  </code></pre>