Django — Debugging {% url django-admindocs-docroot as docsroot %} / TemplateSyntaxError

I hate this error message with a passion. I’m 100% certain that I’ve spent the most time debugging on this specific error, because often times the error message is useless and the stack trace too deep to give any meaningful data.

Remember to remove all .pyc files in your project by running `find . -name “*.pyc” | xargs rm`.

3 Comments

  1. Zac Slade says:

    So I have the same error and just removing the .pyc files does not clear it. Also running a manage.py flush doesn’t fix it either. Got any pointers?

  2. Yuji says:

    This is an exercise in hair pulling unfortunately. My only advice to you is: slowly disable one app at a time while running `find . -name “*.pyc” | xargs rm` until you narrow down the problem app.

    You can then check your version control system for recent modifications to the files in the app that may have caused the error, assuming this app was working before.

    Hope you figure it out!

  3. I just had to deal with this error. Make sure to look through the tracebacks for a local variable “e” – this could be an error that your view is throwing that Django isn’t showing you. Good luck.

Leave a reply to Zac Slade Cancel reply