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.
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:
Comments
Post a Comment