Automatically get parent_host from current visited host
fanckush opened this issue · 1 comments
fanckush commented
The reverse()
(and {% url ...%}
) in django use the same domain name from the user request. shouldn't the reverse()
function (and {% host_url ... %}
) act the same without needing to hard code the PARENT_HOST is the settings
I think the change needs to be around here:
django-hosts/django_hosts/resolvers.py
Line 121 in ad41990
Any thoughts?
LowerDeez commented
Very inefficient solution:
from django.utils.functional import lazy
def parent_host():
from django.contrib.sites.models import Site
site = Site.objects.get_current()
return site.domain
PARENT_HOST = lazy(parent_host, str)()