List Info

Thread: Problem with flatpages and absolute urls




Problem with flatpages and absolute urls
country flaguser name
United States
2007-05-31 09:45:45
I have a problem with flatpages.

When putting links in my templates, I use absolute URLs
without
prepending http://hostname.com/

For example, <a href="/">Home</a> gets
interpreted by the browser as a
link to http://hostname.com/, and
all is correct.

However, when a flatpage is being served, those links get
interpreted
literally, so the link now is http:/// which is of course useless.

I suspect this is something to do with the 404 response that
triggers
something in firefox.

So what am I supposed to do ? Should I prepend everything
with the
hostname ? How can I get the current site (so I won't couple
the
template to the site) ?

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problem with flatpages and absolute urls
country flaguser name
United States
2007-05-31 10:25:36
OK never mind about this. It was my error, I was creating
some URLs
like this:

/{}/path1/path2/

and sometimes var wasn't set so the url becomes:

//path1/path2/

which replaces everything in the browser...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )