3👍
✅
That file (at least the part you posted) does not have any syntax errors. Sometimes errors can appear to come from a different files.
Check the files you’ve recently edited by just running the interpreter on them, python myapp/views.py
or so. If you get NameError or ImportError, or it just runs fine, then there are no syntax errors in myapp/views.py
, so try another file.
Source:stackexchange.com