> What's the best way to use MEDIA_URL in a CSS file. For example, right
> now my CSS file has something like:
>
> body {
> background: transparent url('/media/images/bg.gif') repeat;
> }
>
> I would like to use MEDIA_URL instead of /media/ (in a number of
> places), but other than that the file is static. What's the best way
> to do this? Should I templatize the whole thing? What type of a
> performance change will I see (approximately)?
This changes your CSS file from being static to being dynamic.
As such, Django should serve the file. However, as it's not
something you'd expect to change often, Django's caching
framework (making use of, say, memcached) may prove enormously
helpful. Alternatively, you might be able to hook into the
post_syncdb signal, and use it to write/put the render the
dynamic CSS file into a static CSS file on the static-media server.
Just a few ideas,
-tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---