Browse files

cleanup for pypi release

  • Loading branch information...
stefanfoulis committed Apr 11, 2010
1 parent 112ae87 commit 55835b65ba7f5e3c33780a0e96309105e12db0d7
Showing with 8 additions and 14 deletions.
  1. +7 −14
  2. +1 −0
@@ -1,22 +1,15 @@
the intention of this application is to enable static app files (css, js, pics) in the app folder itself.
-the application should provide a command extension for generating the media folder for deploying on the webserver.
-warnings of dublicate files should be raised
-This view assumes a django application stores its media in app/media (which is very common) and the file is referred
-to in the templates by the last part of a django app path. e.g. As in django.contrib.admin -> 'admin'.
-First we check if the media is a request in an application directory; if so we attempt to serve it from there.
-Then we attempt to provide the document from the document_root parameter (if provided).
+To use this view in development you should add something like the following to
+if settings.DEBUG: urlpatterns += (r'^media/(?P<path>.*)$', '', {'document_root' : settings.MEDIA_ROOT})
-To use this view you should add something like the following to
+For deployment there is a managament command called `symlinkmedia` that will create symlinks to each applications media directory in `MEDIA_ROOT`.
-if settings.DEBUG: urlpatterns += (r'^media/(?P<path>.*)$', '', {'document_root' : settings.MEDIA_ROOT})
+Now all apps in INSTALLED_APPS that have a "media" directory in them will be reachable as '/media/<application_name>/'.
You can then have the admin media files served by setting ADMIN_MEDIA_PREFIX = '/media/admin/'
@@ -7,6 +7,7 @@
+ url = '',
description='Handling django app media',
long_description=open(os.path.join(os.path.dirname(__file__), '')).read(),
platforms=['OS Independent'],

0 comments on commit 55835b6

Please sign in to comment.