skip to navigation
skip to content

django-media-utils 0.1.0

Django utilities for managing static assets

Utilities for managing static files in Django projects.

The serve_app_media view

Serve static assets from media folders in all installed apps in development.

To use, add something like this to your root URLconf:

if DEBUG:
    (r'^media/(?P<path>.+)$', 'media_utils.views.serve_app_media')

The files in my_app/media/ will then be available at the media/ URL as if they were located at MEDIA_ROOT. Files actually at MEDIA_ROOT take precedence, then apps are checked in order of INSTALLED_APPS listing. This is analogous to the app_directories template loader.

A common convention is to place your app's static files under my_app/media/my_app/, in which case they will be served at the URL /media/my_app/.

This view is intended for use in development only. Properly configure your webserver to serve media in production (see the link_media management command below).

File Type Py Version Uploaded on Size # downloads
django-media-utils-0.1.0.tar.gz (md5) Source 2009-06-28 16:39:11.521453 9KB 113

Log in to rate this package.