Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesEverybody knows there is a development server you can run with "manage.py runserver", but did you know that there is a development view for serving static files (CSS / JS / IMG) as well ?
Newcomers are always puzzled because Django doesn't come with any way to serve static files. This is because the dev team think it is the job for a real life Web server.
But when developing, you may not want to set up Apache + mod_wisgi, it's heavy. Then you can just add the following to urls.py:
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),Your CSS / JS / IMG will be available atwww.yoursite.com/site_media/.
Of course, don't use it in a production environment.