In Django, I have many sub domains and these have a theme installed to it. The problem is now I need to implement a function that redirects to the main domain of my project. For example when pressing a link ("Go to main domain") in the sub domain theme it will take them to the main domain.
I can hard code this, but it's not really nice. So I'm looking for other solutions to this.
This is a hardcoded way in views.py:
def network_url(request):
return redirect('https://domain.com/')
So how do I create a function that do not require to hardcode the main domain?