--
()_() | That said, I didn't actually _test_ my patch. | +----
(o.o) | That's what users are for! | +---+
'm m' | (Linus Torvalds) | O |
(___) | raffaele at salmaso punto org |
I have 2 - one is the standard media directory where users upload files and is
outside the project directory, the other I call sitemedia which is a
directory under the the project directory with three directories under it -
css, js and images. This is mapped in apache conf to
http://myproject.com/sitemedia/ - and it is referred to as /sitemedia/ in the
templates. This sitemedia directory is also under version control as part of
the site.
--
regards
KG
http://lawgon.livejournal.com
I still don't think you've explained the problem you're having here.
ImageField and FileField using the upload_to path (and the MEDIA_ROOT
setting) to determine where to store things.
However, you can serve static media from anywhere you like. The
MEDIA_URL setting is used for uploaded media (stuff that is stored under
MEDIA_ROOT), since there's code inside django that uses MEDIA_ROOT for
file reading/write and MEDIA_URL for the URL of those resources. But
that doesn't mean you can't also have static stuff under any other URL
you like. You just need to use a different setting to refer to it.
The only reason Django has the MEDIA_URL setting is because it's a
necessary half of allowing file uploads. It's not required to put all
static media under that URL prefix.
So what is the difficulty here? What is the problem with referring to
your unchanging (non-uploaded) static content in templates, whether via
a string in the source somewhere, or using a different settings variable
of your own naming? Is it conceptual: you're trying to do everything
using MEDIA_URL?
Regards,
Malcolm