I have already implemented this in our in-house django-based
framework. If interested, I can provide it. As you said, it really
does make things very simple.
Regards
Rajeev J Sebastian
Please do, I'd be interested even if it doesn't make it to the trunk.
Erik
Oh, yes! I was trying to invent some way to distribute media (apart from
documenting copying it in a README) but with no luck. Yet your solution
is so simple and beautiful!
$ python manage.py installmedia appname [appname ...]
The command is "dumb."......
http://code.google.com/p/django-command-extensions/
-justin
--
Justin Lilly
Web Developer/Designer
http://justinlilly.com
This is not really a problem, since the media will always be under
<MEDIA_ROOT>/<appname>/..
A problem would be referencing images, and media in css/js files.
Currently, in all our projects we use /site_media/ as the MEDIA_URL,
so this not a problem. But for a true solution, there should be a
preprocessor for css/js to use the MEDIA_URL within it.
Another problem which we havent solved, is overrides. E.g., when we
use a "plugabble"/reusable app with its own media, and we want to
override this in our project, how should the collect media command
work ?
Anyway, I've attached our media app (with the command, etc). If you
want any changes to be included, please do tell me.
Regards
Rajeev J Sebastian
Has anyone got some good use cases where the template-loaded mimicking
behavior would be desired? Otherwise it's just needless complexity in
my opinion.
I love the whole installmedia command idea though.
Erik
I got an idea though when reading your post. Since people want to
update reusable apps to a more recent version/revision and since that
means the media files will/might change, why not add another command
that would show which installed media files differ from the default
ones provided by apps? That would show both which files have been
overridden and which files have been changed by recent updates. I
guess if you have means to compare file trees already, it would be a
simple thing to add. The command could be named "comparemedia" or
"mediastatus" or similar.
Erik