I've been getting this error message for a while now, but actually the code works fine and runs as expected, the line causing the error is this:
templates/users/dashboard.html->
<link rel="stylesheet" href="{% static 'css/dashboard.css' %}">
when i remove the quotations i get a deferent error:
<link rel="stylesheet" href={% static 'css/dashboard.css' %}>
ERROR: Invalid Token. Expected stringStart but found tag start "{%" instead.
when i completely remove the line i get the same erro on the first tag with href:
<a href="{% url 'login' %}">Logout</a>
ERROR: Invalid Token. Expected stringEnd but found tag start "{%" instead.
i suspect that its a vscode issue, because the code runs flawlessly, and it only catches the error when i clean the code(format), so as long as i open vscode and never hit (ctrl+shidt+f) i dont get the error message, is there a solution for this?
I got the same error. The problem was a VS Code extension, in my case it was "Django Template Support" from junstyle.
If anyone has the same problem, try to deactivate all your extensions in VS Code, restart the editor and try again.
Had the same behaviour today in vs code. Problem was a conflict within the django extensions in vs code, which I had installed. You may check your django extensions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With