Django — TypeError Str Object Not Callable Urls.py

I got this error recently in my urls.py.

We should naturally be looking for a string in our urls.py (error says str object) and I found that my comment “”” “””” was being the issue.

I’m used to placing a lone string at the beginning of a class or function, but in this case it was in the middle of defining the urlpatterns, so the url parser actually tried to read my string comment.

Just a heads up.

3 Comments

  1. Mark Drago says:

    This just saved me a bunch of time. I had commented out some lines in my urlpatterns and I never would’ve thought that was the problem if I hadn’t found this page. I removed the commented lines and it worked. Thanks!

  2. Yuji Tomita says:

    Hey Mark, glad it helped! Thanks for sharing : )

  3. Yuji says:

    I did this a moment ago ago too..

Leave a Comment