Re: Managing static media urls

2006-01-20 Thread Kevin
I think the question at hand is not where to store and serve the media files, but how to write an app that can easily support accessing media files from different urls. I had this same issue between my development and production apache servers: Dev Site localhost/mysite/images/whatever.gif

Re: Managing static media urls

2006-01-20 Thread Nebojša Đorđević
Afternoon wrote: I'm not just using this for media (despite the subject line!). I also the URLBASE for building absolute urls in models and in templates. MEDIA_URL generally ends up as something like: MEDIA_URL = URLBASE + "/media/" Yes, I also hit the same problem, but because I

Re: Managing static media urls

2006-01-20 Thread Afternoon
I'm not just using this for media (despite the subject line!). I also the URLBASE for building absolute urls in models and in templates. MEDIA_URL generally ends up as something like: MEDIA_URL = URLBASE + "/media/" Something like Rails' routing would be really interesting for

Re: Managing static media urls

2006-01-17 Thread [EMAIL PROTECTED]
I think there are a few ways of doing this in previous messages, but here's what has worked for me, using a custom context processor. In settings, I add whatever custom variables I want, including this: APP_BASE = "http://www.example.com/; I have an app called home, and in the views.py I put

Re: Managing static media urls

2006-01-17 Thread Afternoon
I'd like to have a solution to this problem too. My specific problem is that I have a bunch of sites in development on my laptop: http://localhost/coolsite/ http://localhost/boringsite/ http://localhost/newhomepage/ And these then get deployed to production

Re: Managing static media urls

2006-01-14 Thread Greg
Thanks for the advice guys. Amit, yeah I should have mentioned that I totally agree that django shouldn't serve static files in a production environment. And keeping a /static/ directory sounds like a pretty good way to do that. I started writing something more like Andy's #2 suggestion... a way

Re: Managing static media urls

2006-01-14 Thread Andy Shaw
Amit Upadhyay wrote: > Static files are best served by basic http servers and not django. > Django tries to support serving static files, but that is only for > convenience in development. Just now I finished deploying a django > project under mod_pythong/apache, and my approach was to setup a

Re: Managing static media urls

2006-01-14 Thread Amit Upadhyay
On 1/14/06, Greg <[EMAIL PROTECTED]> wrote: your folder structure. This issue seems especially pertinent for Djangobecause although the mechanism for assembling several apps together onone server is a sweet way to make it easy to combine and reconfigure applications, having to specify a single

Managing static media urls

2006-01-13 Thread Greg
Andy Shaw posed an interesting question in the topic "CSS and PNG files in templates" (in this discussion group)... what kind of URL do you put in a template when you want to refer to a static file? If you use URLs that encode too much information (like a hostname or an absolute path), then it