I use `_path` and keep all urls relative in most of my code.

When I need an absolute url, such as for a canonical tag, I pull the prefix 
off a global variable.

I will also use a `<base >` tag to set the base url for relative urls.

I find this easier for the following situations, so just do it for all 
situations:
* multi tenant applications
* shifting domains and ports (dev/staging/etc) where I don't want to worry 
about configuring multiple files with the domain/port

if _url works for you, awesome.

I probably only use the _path commands 1% of the time that involves 
generating urls though. most of that stuff in my apps is handled by 
business logic.


On Wednesday, May 29, 2024 at 2:32:53 AM UTC-4 Petr Blahoš wrote:

> Hi,
> I have been using pyramid for many years and I have always been
> using
>
>    - request.resource_url
>    - request.static_url
>    - or similar ending with _url.
>
> Yesterday when trying to make IIS work as a reverse proxy I noticed
> that the links in my pages contain *scheme://hostname:port* part of the
> URL too. So I am thinking: Should I always use the resource*_path* / 
> static*_path*
> functions to make the URLs?
>
> What are your thoughts?
> Thanks, 
> Petr
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/35119e2b-4402-476a-8160-c0420c4d5f94n%40googlegroups.com.

Reply via email to