Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>@Erik Forsberg's answer worked for me. Here's what I had to do:</p> <ul> <li><p>Comment out the staticfiles app from <code>INSTALLED_APPS</code> in <code>settings.py</code>:</p> <pre><code>INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', #'django.contrib.staticfiles', ) </code></pre></li> <li><p>Leave my <code>STATIC_URL</code> variable set in <code>settings.py</code>:</p> <pre><code>STATIC_URL = '/static/' </code></pre></li> <li><p>Add an entry to my project's base <code>urls.py</code>:</p> <pre><code># static files w/ no-cache headers url(r'^static/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), </code></pre></li> </ul> <p>Note that I'm also setting the <code>Cache-Control</code> headers in a middleware class <code>nocache.py</code>:</p> <pre><code>class NoCache(object): def process_response(self, request, response): """ set the "Cache-Control" header to "must-revalidate, no-cache" """ if request.path.startswith('/static/'): response['Cache-Control'] = 'must-revalidate, no-cache' return response </code></pre> <p>And then including that in <code>settings.py</code>:</p> <pre><code>if DEBUG: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'nocache.NoCache', ) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload