jazzband / django-hosts

Dynamic and static host resolving for Django. Maps hostnames to URLconfs.
http://django-hosts.rtfd.org
Other
982 stars 106 forks source link

Two domains - host is selected randomly #78

Open Tyrdall opened 6 years ago

Tyrdall commented 6 years ago

I have the following conf:

from django_hosts import patterns, host

host_patterns = patterns(
    '',
    host(r'foo\.foo\.de', 'project.urls_1', name='foo'),
    host(r'bar\.bar\.com', 'project.urls_2', name='bar'),
    # host(r'localhost\:8000', 'project.urls_2', name='localhost'),
    host(r'(\w+)', 'project.urls_1', name='wildcard'),
)

Locally it's working fine. On production the host selection is completely random. Sometimes if I refresh the same page it switches between the hosts.

Any ideas? :/

Django==1.10.8 django_hosts==3.0

griffinkelly commented 6 years ago

DId you manage to figure this out? I'm attempting to do the exact same thing

Tyrdall commented 6 years ago

@griffinkelly I gave up and added different wsgi.py files for the different domains, which point to different settings with a different ROOT_URLCONF.