Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Kip Parker
On Sep 16, 5:42 pm, Dana <[EMAIL PROTECTED]> wrote: > Kip, don't you mean {{ model.get_image_url }}? > get_FOO_url() has gone in Django 1.0. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Dana
Kip, don't you mean {{ model.get_image_url }}? Using {% url %}, get_absolute_url, MEDIA_ROOT, sites framework and url.py should be able to accomplish what you are looking to do and more. Also look into the permalink decorator while you're at it. Good luck! On Sep 16, 8:27 am, Kip Parker

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Kip Parker
No, nothing to do with HTTP_HOST, that comes from the server. The point of the sites framework is to differentiate between different sites, so a * site would be pointless. If I were you I'd sort out my templates so that instead of /some/media/location/css/styles.css you have

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread est
Thank you Kip. Call me stupid but does site framework have something to do with HTTP HOST header? But in my case the site is for ANYSITE, no matter you visit the site by IP, domain, or even customized CNAME you cann visit the site with out any problem (Why there isn't a wildcard * in site

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Kip Parker
> no, it's not THAT simple. It really is that simple, honest, but your brain has made it all complicated. Look at http://docs.djangoproject.com/en/dev/ref/contrib/sites/ (sites framework), TEMPLATE_CONTEXT_PROCESSORS setting and RequestContext and the URL dispatcher docs, the answers to your

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread ekellner
On Tue, Sep 16, 2008 at 10:02 AM, est <[EMAIL PROTECTED]> wrote: > > Today, my boss came to me and asked: "Please move our django site from > http://xxx.com/ to http://xxx.com/v2/; > > It's killing me. Just image how huge mount of HTML source code to > modify. > I STRONGLY suggest django

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread David Reynolds
On 16 Sep 2008, at 9:53 am, Donn wrote: > How about > 1. making a link under /var/www/assets to /whatever/v2/assets > 2. move your assets directory into /whatever/v2/ > 3. setup your webserver to go look at /var/www/assets when media is > served. > > You should be able to arrange something

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Donn
On Tuesday, 16 September 2008 10:32:54 est wrote: > http://xxx.com/assets/main.css > Now the problem is, how can I massively move all template under a new > sub-directory URL like http://xxx.com/v2/ ? How about 1. making a link under /var/www/assets to /whatever/v2/assets 2. move your assets

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread est
First thanks all of you for the quick reply! On Sep 16, 4:10 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-16, o godz. 10:02, przez est: > > > > > > > > > Today, my boss came to me and asked: "Please move our django site from >

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Erik Allik
Seems like you have a lot of URLs hardcoded -- you shouldn't do that. Use MEDIA_URL for static media files and the {% url %} tag for dynamic URLs (or django.core.urlresolvers.reverse in Python code). Erik On 16.09.2008, at 11:02, est wrote: > > Today, my boss came to me and asked: "Please

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Tim Kersten
The domain isn't changing. It's just the path, so links that use absolute paths will break. In a way I get it - using relative urls is easy to break something if you need to move it. Also copy & paste becomes hard. Perhaps an APPNAME_URL in your request context would help? Tim ^,^ 2008/9/16

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Tim Kersten
Isn't that what MEDIA_URL is for? At least for your images and css resources. And as for the rest of the urls... urls.py? Tim ^,^ On Tue, Sep 16, 2008 at 9:02 AM, est <[EMAIL PROTECTED]> wrote: > > Today, my boss came to me and asked: "Please move our django site from > http://xxx.com/ to

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-16, o godz. 10:02, przez est: > > Today, my boss came to me and asked: "Please move our django site from > http://xxx.com/ to http://xxx.com/v2/; > > It's killing me. Just image how huge mount of HTML source code to > modify. > > I STRONGLY suggest django

Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread est
Today, my boss came to me and asked: "Please move our django site from http://xxx.com/ to http://xxx.com/v2/; It's killing me. Just image how huge mount of HTML source code to modify. I STRONGLY suggest django implement a 'project url' like asp.net, say where ~ always points to the current