How to use Django to get the name for the host server?

后端 未结 7 2011
天命终不由人
天命终不由人 2020-12-13 17:18

How to use Django to get the name for the host server?

I need the name of the hosting server instead of the client name?

相关标签:
7条回答
  • 2020-12-13 17:48

    If you need to get http(s)://hostname/ you can use the following:

    request.build_absolute_uri('/')

    All useful methods are listed here

    0 讨论(0)
提交回复
热议问题