Permalink
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 README.md
  2. +1 −0 setup.py
View
@@ -1,22 +1,15 @@
the intention of this application is to enable static app files (css, js, pics) in the app folder itself.
-<application1>/media/js/script.js
+<application1>/media/<application1>/js/script.js
+<application2>/media/<application2>/js/script.js
-<application2>/media/js/script.js
-<application2>/media/js/script2.js
+<project>/media/logo.jpg
-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 urls.py:
+if settings.DEBUG: urlpatterns += (r'^media/(?P<path>.*)$', 'site.media.serve_apps', {'document_root' : settings.MEDIA_ROOT})
-To use this view you should add something like the following to urls.py:
+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>.*)$', 'site.media.serve_apps', {'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/'
View
@@ -7,6 +7,7 @@
author_email="digi@treepy.com",
name='django-appmedia',
version=appmedia.__version__,
+ url = 'http://github.com/divio/django-appmedia',
description='Handling django app media',
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
platforms=['OS Independent'],

0 comments on commit 55835b6

Please sign in to comment.