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

url template tag reverse-lookup error when using {% load subdomainurls %} #33

Open
swizzlevixen opened this issue Jun 28, 2014 · 0 comments

Comments

@swizzlevixen
Copy link

I am using django-subdomains to enable subdomains for two different apps in my django project, and it seems work well. The one thing I'm having trouble with is reverse-lookup urls in the template tags.

(I'm on Python 2.7, Django 1.6.5)

If I am using the basic {% url 'foo_view' %}, these URLs resolve fine. However, after I add the call {% load subdomainurls %} to the top of my template:

  • {% url 'foo_view' subdomain='www'%} works
  • {% url 'foo_view' %} does not, and raises a NoReverseMatch exception

Nothing else in the template or project has changed. This happens even though the django-subdomains docs state that:

If request is in the template context when rendering and no subdomain is provided, the URL will be attempt to be resolved by relative to the current subdomain. If no request is available, the URL will be resolved using the same rules as a call to subdomains.utils.reverse() without a subdomain argument value.

So, it seems like my app is demanding that I add a subdomain='foo' to the url call (it works when I add that!), even though the docs say it should handle it fine without the subdomain. Is there a reverse-lookup "helper" that I need to add somewhere? ...or is this possibly broken?

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