Maybe it's old/or and documented[1] but yesterday i was looking for an easy

way to serve static files (for istance css,images,etc.) with Django using the development webserver.

After a quick search i found a solution

(ok maybe it's not the _best_ way to do it but works4me!).

Say that you want to serve images and css in with two different path,

add the following:


STATIC_IMG_ROOT = '/fullpath/to/mycontent/img/'

STATIC_CSS_ROOT = '/fullpath/to/mycontent/css/'



(r'\^img/(?P\<path>.*)\$', 'django.views.static.serve',

{'document_root': settings.STATIC_IMG_ROOT}),

(r'\^css/(?P\<path>.*)\$', 'django.views.static.serve',

{'document_root': settings.STATIC_CSS_ROOT}),


Now in your templates you can link to images and css via:

[..] awesome_header.png" width="137" height="121" [..]


[..] rel="stylesheet" type="text/css" href="css/main.css" [..]

Remember to disable these settings in and when you are going in production.