13👍
IMPORTANT: this was for django 1.4. At django 1.5 it is just the opposite.
try using url names without quotes
{% url show %}
not this
{% url 'show'%}
10👍
The problem is your single quotes around ‘show’. Change this to “show” and it should work out for you.
See here
3👍
You maybe have some views not implemented yet. It looks like the template engine tries to find all views from the patterns in urls.py when the {% url … %} filter is used.
It usually shows an error for your last pattern in urls.py.
Try comment out every url pattern you did not implement yet.
Also make sure you use the full path:
{% url myapp.views.home %}
The url template filter looks really unstable. Try to keep future compatibility.
- Is it possible to return an HttpResponse in django with text & a json object?
- Filtering the Aggregate in the Django ORM
- How to use –failfast in django test command line?
- Django Ajax "FORBIDDEN" error
1👍
You may need to be a little more specific on which view you’re trying to use:
{% url appname.views.show %}
- Django queryset: Exclude list of emails using endswith
- How can I hide a django label in a custom django form?
0👍
For what is is worth, I had the same issue and while I do not remember the reason why now, this resolved it for me. Example from a SCRUM app I was working on.
url(r'^$', 'scrum.views.index', name='scrum-index'),
- From django.db import models, migrations ImportError: cannot import name migrations
- How to make TimeField timezone-aware?
- Authenticating Swagger API docs (drf-yasg)
- Django haystack: which search engine would be better
0👍
Django 1.5 or above:
{% url 'show'%}
Django 1.4 or below:
{% url show %}
*You can see Django 1.5 release notes.
- Put the result of simple tag into a variable
- Django: Access request object from admin's form.clean()
- Database trouble in Django: can't reset because of dependencies
- How to setup APScheduler in a Django project?