How do you serve static files when using the django runserver development server? -


i using django 1.5

i able serve files in production because being handled @ apache level. here httpd.conf file:

<virtualhost *:80> wsgiscriptalias / /home/membership/membership/wsgi.py  alias /static/ "/home/membership/static/"   <directory /home/membership/static> order deny,allow allow </directory>  <directory "/usr/lib/python2.6/site-packages/django/contrib/admin/static/admin">     order deny,allow     allow </directory>  <directory /home/membership/membership> <files wsgi.py> order deny,allow satisfy allow </files> </directory> </virtualhost> 

this works fine in production because of alias /static/ "/home/membership/static/"

when try , run app in local development environment can't serve static files page not found 404 error. guess because when develop locally requests going straight development server since apache not being used.

enter image description here

i have file @ /static/me.png .

is there somewhere supposed specify serve static files in development?

when running python manage.py collectstatic seems collect static files admin app. have file directly in /app/static directory trying serve.

did define path static files in site's settings? don't mean url /static/, mean staticfiles_dir (it's tells devserver static files config file tells apache)

it's best follow documentation, absolutley fantastic:

documentation


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -