Search code examples
pythonsettingspyramid

How to get the serving host and port in python pyramid application?


I am trying to get the serving host and port of a pyramid applications using:

settings = get_current_registry().settings

But how can I get the host?

I tried:

settings.get('host')

But I am getting None

Any help is much appreciated.


Solution

  • request.host or request.host_url
    

    pyramid.request