On Sep 19, 4:26 pm, Brian Beck <[EMAIL PROTECTED]> wrote:
> I also have an implementation that I'll post when I get home.

I just posted my collectmedia (I liked the name Rajeev used) command
here: http://www.djangosnippets.org/snippets/1068/

It's a long snippet because it includes an interactive mode and sets
permissions (see below).  For testing, I recommend running with -i and
-n (interactive mode and dry run mode, respectively).  I've tested it,
but you should probably back up your media first.

Features:

If multiple apps provide a media file of the same name, use the file
provided by the app listed first in INSTALLED_APPS - this mimics the
template loader behavior.  In interactive mode (-i), you may specify
which app to select from for each such file.  With this command, best
practice would be to put media files at app/media/appname/... - just
like templates.

It attempts to be "smart" about permissions by using MEDIA_ROOT's
permissions and ownership on all the files it creates.  So, if
MEDIA_ROOT is owned by apache/www-data for instance, the media files
should, too.

You may provide a directory other than MEDIA_ROOT to copy to.  You may
also use symbolic links instead of copying, but this doesn't work on
Windows, so copying is the default behavior.  See the code for the
other options...

Thoughts?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to