143๐
This error usually means youโve forgotten a closing quote somewhere in the template youโre trying to render. For example: {% url 'my_view %}
(wrong) instead of {% url 'my_view' %}
(correct). In this case itโs the colon thatโs causing the problem. Normally youโd edit the template to use the correct {% url %}
syntax.
But thereโs no reason why the django admin site would throw this, since it would know itโs own syntax. My best guess is therefore that grapelli
is causing your problem since it changes the admin templates. Does removing grappelli from installed apps help?
12๐
For me it was using {{ }} instead of {% %}:
href="{{ static 'bootstrap.min.css' }}" # wrong
href="{% static 'bootstrap.min.css' %}" # right
- [Django]-What does Django's @property do?
- [Django]-Django REST Framework custom fields validation
- [Django]-CharField with fixed length, how?
5๐
There should not be a space after name
.
Incorrect:
{% url 'author' name = p.article_author.name.username %}
Correct:
{% url 'author' name=p.article_author.name.username %}
- [Django]-Stack trace from manage.py runserver not appearing
- [Django]-Reference list item by index within Django template?
- [Django]-Form with CheckboxSelectMultiple doesn't validate
2๐
Template Syntax Error: is due to many reasons one of them is {{ post.date_posted|date: โF d, Yโ }} is the space between colon(:) and quote (โ) if u remove the space then it work like this โฆ.. {{ post.date_posted|date:โF d, Yโ }}
- [Django]-Where should signal handlers live in a django project?
- [Django]-Catching DoesNotExist exception in a custom manager in Django
- [Django]-Django: How to manage development and production settings?
2๐
In templates/admin/includes_grappelli/header.html, line 12, you forgot to put admin:password_change
between '
.
The url Django tag syntax should always be like:
{% url 'your_url_name' %}
- [Django]-Django or Django Rest Framework
- [Django]-One-to-many inline select with django admin
- [Django]-Django models.py Circular Foreign Key
1๐
also happens when you use jinja templates (which have different syntax for calling object methods) and you forget to set it in settings.py
- [Django]-Django: guidelines for speeding up template rendering performance
- [Django]-Convert Django Model object to dict with all of the fields intact
- [Django]-How do I perform query filtering in django templates
1๐
You have indented part of your code in settings.py:
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
#'django.contrib.admindocs',
'tinymce',
'sorl.thumbnail',
'south',
'django_facebook',
'djcelery',
'devserver',
'main',
Therefore, it is giving you an error.
- [Django]-Are Django SECRET_KEY's per instance or per app?
- [Django]-Testing email sending in Django
- [Django]-How do I clone a Django model instance object and save it to the database?
1๐
for me, when I checked if condition:
This made error:
{%if number==10 %}
This solved error:
{% if number == 10 %} #you may notice about space!
- [Django]-Elegant setup of Python logging in Django
- [Django]-Fighting client-side caching in Django
- [Django]-Django 1.7 throws django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet
0๐
Make sure you are using static files and URLs properly
<link href="{% static 'css/semantic.min.css' %}" rel="stylesheet">
- Check it is properly surrounded with quotation marks or not
- Check beginning and ending brackets
- Check tag is closed properly or not
- [Django]-Getting a count of objects in a queryset in Django
- [Django]-Custom django admin templates not working
- [Django]-WSGI vs uWSGi with Nginx
0๐
I got the same error below:
django.template.exceptions.TemplateSyntaxError: Could not parse the remainder: โ:testโ from โmy_app1:testโ
Because I didnโt use quotes for my_app1:test
with url tag as shown below. *Since Django 1.5, quotes have been needed:
<a href="{% url my_app1:test %}">Test</a>
{% โ No quotes โ %}
So, I used quotes for my_app1:test
with url
tag as shown below, then the error was solved:
<a href="{% url 'my_app1:test' %}">Test</a>
{% โ quotes โ %}
- [Django]-Django FileField: How to return filename only (in template)
- [Django]-Django filter JSONField list of dicts
- [Django]-Django: Does prefetch_related() follow reverse relationship lookup?