Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolvers.reverse not pointing to domain, am I doing something wrong? #38

Closed
int-ua opened this issue Jul 6, 2015 · 1 comment
Closed

Comments

@int-ua
Copy link

int-ua commented Jul 6, 2015

Django 1.8.2, django-hosts 1.2

Config:

host_patterns = patterns('',
    host(r'', 'project.urls', name='root'),
    host(r'www', 'project.urls', name='www'),
...

Django shell example:

>>> from django_hosts.resolvers import reverse
>>> reverse("namespace:view", kwargs={'arg':8, 'pk':1}, host='www')
'//www/arg8/pk/1/'
>>> reverse("namespace:view", kwargs={'arg':8, 'pk':1}, host='root')
'///arg8/pk/1/'

Why isn't it //www.domain.com/arg8/pk/1/?

@int-ua
Copy link
Author

int-ua commented Jul 6, 2015

Ok, adding

PARENT_HOST = ALLOWED_HOSTS[0]

to the settings.py helped. What do you think about defaulting PARENT_HOST to ALLOWED_HOSTS[0]? Looks reasonable to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant