When I develop my Django app example, I meet an error with TemplateSyntaxError: Could Not Parse The Remainder error message like below. This error is so strange but so simple to fix, but it cost me a lot of time. So I want to write down the solution here for the reader to fix it quickly to save time.
From the above picture, we can locate the source code line of the error, it is below the code line.
<link rel=”stylesheet” href=”{% static ‘css/dept_emp_style.css’ %}”>
If you do not look at the above external CSS stylesheet file include the command carefully, you will find it is so strange, why this line of code throws an error. But if you look at it carefully, you will think the error message is very helpful and clear TemplateSyntaxError: Could Not Parse The Remainder.
The error is because of the Django static tag’s argument ‘css/dept_emp_style.css’, the single quote( ‘ ) is not an English character. Instead, it is a Chinese character. This is a stupid error I think.
So if you meet such an error TemplateSyntaxError: Could Not Parse The Remainder, you should check your statement grammar carefully, especially whether the single or double quote is English character or not, and whether the single or double quote ending correctly.
Thanks a ton!
u
Thank you so much for the help
You saved my life. Now I feel so stupid. Good job with the post
thank you , i was about cry over it man . this is so stupid man thnx
holllllllllllllllllllllllllllllllllllllllly shit……
thank you sooooooooooooooooooooooooooooooooooo much…
i was going crazyy….
i spent a lot of time resolving this stupid error..finally i get it here
thank you again…
I had copied my {% extends “admin/change_form.html” %} off the internet and didnt realize that the ” was actually another type of character that just looked the same so thank you for this post that put me on the right direction!