Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 824
QLands Avatar asked Mar 21 '23 18:03

QLands


1 Answers

request.host or request.host_url

pyramid.request

like image 58
Paul Yin Avatar answered Apr 07 '23 08:04

Paul Yin