I still can't understand why you can use relative URLs to images in your CSS files. If you keep your CSS files together with your image files, nothing will break if you move them to another URL.
Sorry if I'm missing something obvious. Erik On 18.09.2008, at 20:56, MrJogo wrote: > > Erik: I can't use relative URLs because of how my hosting service (my > university) is set up. Each account is at something like > www.university.edu/~studentname/. I could hard code it if I were > leaving it on my space, but I'm making it for a group (which has space > at www.university.edu/group/groupname/), and when I move it over, I'd > like to have to go through and change as little as possible. > > Tim: I'll look into those solutions. > > Thanks to both of you. > > On Sep 13, 4:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote: >>> 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 django-users@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-users?hl=en -~----------~----~----~----~------~----~------~--~---