get current site django 1

get current site django

from django.contrib.sites.shortcuts import get_current_site
domain = get_current_site(request).domain

Here is what the above code is Doing:
1. Get the current site from the request.
2. Get the domain from the site.
3. Use the domain to build the URL.

Similar Posts