You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 aNoReverseMatch
exceptionNothing else in the template or project has changed. This happens even though the django-subdomains docs state that:
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?The text was updated successfully, but these errors were encountered: