Is there function returns the current site url

HI all,

is there function returns the current site url?

@mostafa, which side? backend or client?

You can try get_url from frappe.utils

1 Like

https://frappe.github.io/frappe/current/api/utils/frappe.utils.html

frappe.utils.get_url()

1 Like

The last answer is a bit older and not valid anymore.

Full solution to be found here:

Yes from the client side

Below is the solution to get site name

from frappe.utils import cstr

get the site_name
site_name = cstr(frappe.local.site)

2 Likes