Fetch host_name from site_config via ServerScript or Webhook

Hello Guys,

I’ve been searching how to get the host_name from my ERPNext site via Server Script, or webhook, I don’t even know if it’s possible, but so far I didn’t find anything for now.

I’m trying to send the erpnext URL when I add a new User/Student via Webhook to the endpoint I need, because in the future I’ll need to have more than 1 instace of ERPnext running, if there a possibility to do that, it’ll help me a lot.

Does anyone know if it’s possible to do?

Hi @mtssantos18:

Use this on server script …
host = frappe.utils.get_host_name()

From client side you can get the sitename with

Hope this helps.