Django media-serving dev webserver
Jan 3rd, 2006 by Phil Dawes
I’ve been porting my jamvat software to the django platform. Django looks cool and I hope it will get me some
- Get jamvat running on the windows platform
- Provide some UI, connection pooling, security and debugging goodies
- Remove some setup documentation burden (since it’s a ‘django app’)
Anyway, I was immediately hit by the problem that the django dev webserver doesn’t serve static files (i.e. js, images, css etc..), except for urls in the built-in admin server. I can’t work out why, and I can’t see why people aren’t complaining about this - I can only assume that it wants you to use a ‘proper’ webserver to serve these files even while you’re deving.
I couldn’t find a solution to this, so have written a hack that does the same thing as django does for the admin server files. Just set ‘MEDIA_ROOT’ and add a ‘DEV_MEDIA_PREFIX’ to your project settings, then run the script instead of ‘django-admin.py runserver’.

Add New Comment
Viewing 2 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment