Re: base_url() in django

2012-06-26 Thread Kurtis Mullins
> > The case we're trying to make is -- why do that? Just like Raitucarp said, > using an absolute path provides the same end-result as including the > hostname and protocol. There's only a few cases where you'd want to do that > Whoops, sorry Raitucarp. I meant Melvyn :) -- You received this

Re: base_url() in django

2012-06-26 Thread Kurtis Mullins
We understand the issue. You want to display absolute URL including the hostname and protocol in your templates. That's not difficult to do, you just need to write a custom template tag to do this. There's many ways to go about doing this -- however, if you're only running a single web-site on

Re: base_url() in django

2012-06-26 Thread Raitucarp
> Is this an actual issue? You realize that there's no difference between > /doc/ and http://example.com/doc/ if the current server is > http://example.com/? > > See here: > https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#url > No no, that's not my issue. {% url %} template

Re: base_url() in django

2012-06-25 Thread Jani Tiainen
One actual use-case I have is when sending links in emails, for example confirmations, password resets links etc. And IIRC there is a way to do it in Django it's just not documented. Personally I resolved it by using configuration variable in settings.py since in my case actual Django

Re: base_url() in django

2012-06-25 Thread Kurtis Mullins
> > Is this an actual issue? You realize that there's no difference between > /doc/ and http://example.com/doc/ if the current server is > http://example.com/? > +1 I'd like to see the use-case where having absolute URLs everywhere is actually necessary. It's not hard to do in certain places

Re: base_url() in django

2012-06-25 Thread Melvyn Sopacua
On 25-6-2012 17:02, Raitucarp wrote: > @Melvyn > > That's not simple way. I have to write every views to pass it on to > template? It's not elegant by the way. uhm Should I create custom template > tags to do it in beautiful way? Is this an actual issue? You realize that there's no difference

Re: base_url() in django

2012-06-25 Thread Raitucarp
@Melvyn That's not simple way. I have to write every views to pass it on to template? It's not elegant by the way. uhm Should I create custom template tags to do it in beautiful way? Because base_url() in codeigniter is a helper. And I don't need write it on to controllers(views in django),

Re: base_url() in django

2012-06-25 Thread Melvyn Sopacua
On 25-6-2012 3:10, Raitucarp wrote: > http://example.com > or > https://example.com You also do this in your view functions, using the Site framework: Then pass it on to template. -- Melvyn

base_url() in django

2012-06-24 Thread Raitucarp
Actually, I was PHP developer, I use codeigniter as framework. In codeigniter, we can call helper url functions base_url() and it will return absolute domain url such: http://example.com or https://example.com It is automatically, we even don't need to create custom function, because