pombreda / django-hotclub

Automatically exported from code.google.com/p/django-hotclub
MIT License
0 stars 0 forks source link

Best practices for media files #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
jezdez explained on irc where to put media files and it could be helpful in
the documentation:

- When you want to override default media files, place yours under
myproject/media/... with the same path. For example:
original file:
src/pinax/media/default/pianx/images/logo.png
your file:
myproject/media/pinax/images/logo.png

- Site specific media files goes to:
myproject/media/siteExample.js

- App specifi media files goes to:
myproject/myapp/media/myapp/appExample.js
That "namespacing" is required to prevent name collision of media files
while running the build_media command

The special static file service view should be able to serve the media
files in development.
The build_media script should be able to collect the media files from pinax
and all the apps and arrange them under the myproject/site_media folder.

I didn't test it myself yet so if I made a mistake please comment.

Original issue reported on code.google.com by pablo.platt@gmail.com on 21 Feb 2009 at 12:36

GoogleCodeExporter commented 9 years ago
The command:
(pinax-env) myproject/python manage.py build_media
will collect the media files from pinax, django and all the apps and place them 
in
the site_media folder.

If you have two apps with the same file and the same relative path you need to 
use
the --interactive option so the script will prompt you to choose which one to 
use.
This is useful in case you want to overwrite default media files with your 
custom app
for example. Remember to remove the site_media folder before you use this 
option or
the script will prompt you for each file. 

Original comment by pablo.platt@gmail.com on 1 Mar 2009 at 1:04

GoogleCodeExporter commented 9 years ago

Original comment by pyDanny on 13 Mar 2009 at 4:37

GoogleCodeExporter commented 9 years ago
we should document this for b1

Original comment by jtau...@gmail.com on 16 Mar 2009 at 2:54

GoogleCodeExporter commented 9 years ago
Moved to http://code.pinaxproject.com/tasks/task/75/

Original comment by pyDanny on 1 Apr 2009 at 1:46