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 thoughts on “Django — TypeError Str Object Not Callable Urls.py

  1. 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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s