Home > Blog > Serving custom Django admin media in development

Serving custom Django admin media in development

December 6th, 2009 david Leave a comment Go to comments

I’ve just discovered Django‘s development server always serves admin media. This is tremendously useful because it means you don’t need to configure a static serve view in your project urls.py during development.

However what bit me was I wanted to use a customised set of admin media and had configured a view for the ADMIN_MEDIA_URL path and was going batty trying to work out why Django was ignoring it. It used to be that as long as you had DEBUG = False in settings.py then the development server did not try to help serve the admin media automatically.

Changeset 6075 added a switch to the runserver command for over-riding the admin media directory.

python manage.py runserver --adminmedia /path/to/custom/media

That change was made more than two years ago. It is right there in the documentation. A little bit of magic that wasted fifteen minutes of my frantic schedule (except for the fact I do not have a frantic schedule).

Tags:
  1. December 12th, 2009 at 07:00 | #1

    Awesome, I didn’t heard about this topic up to now. Thanks.

  1. No trackbacks yet.