Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you serve static files when using the django runserver development server?
    text
    copied!<p>I am using django 1.5</p> <p>I am able to serve the files in production because it is being handled at the apache level. Here is my httpd.conf file: </p> <pre><code>&lt;VirtualHost *:80&gt; WSGIScriptAlias / /home/membership/membership/wsgi.py Alias /static/ "/home/membership/static/" &lt;Directory /home/membership/static&gt; Order deny,allow Allow from all &lt;/Directory&gt; &lt;Directory "/usr/lib/python2.6/site-packages/django/contrib/admin/static/admin"&gt; Order deny,allow Allow from all &lt;/Directory&gt; &lt;Directory /home/membership/membership&gt; &lt;Files wsgi.py&gt; Order deny,allow Satisfy Any Allow from all &lt;/Files&gt; &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>This works fine in production because of the <code>Alias /static/ "/home/membership/static/"</code></p> <p>When I try and run the app in my local development environment I can't get it to serve static files I just get a page not found 404 error. I am guess that this is because when I develop locally the requests are going straight to the development server since apache is not being used.</p> <p><img src="https://i.stack.imgur.com/wtPCe.png" alt="enter image description here"></p> <p>I do have a file at /static/me.png . </p> <p>Is there somewhere that I am supposed to specify to serve static files in development? </p> <p>When running <code>python manage.py collectstatic</code> it seems to collect only the static files for the admin app. I have a file directly in the /app/static directory that I am trying to serve. </p>
 

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