24. November 2016 2 min read

Django 1.10 TypeError, TemplateDoesNotExist

Django 1.10 update brings quite some pain, although I was following updates very closely. But I was not really paying attention to what will be deprecated in 1.10 and this has bitten my ass. I have some really old Django projects and while new settings.py is created without deprecated stuff, the legacy has to be updated manually.

Django TypeError view must be a callable or a list/tuple in the case of include()

This error hits first and all you need to do is to remove any strings referencing functions you have in your url.py. That means change:

url(r'^login/$', 'django.contrib.auth.views.login'),
from django.contrib.auth.views import login
url(r'^login/$', login),

Django TemplateDoesNotExist error

TEMPLATES_DIR is now deprecated. That meas you need to change everything to the TEAMPLATES array. All the details are on official documentation and careful reading tells you that you also need to replace django.core.context_processors with django.template.context_processors in the names of context processors.

patterns are also deprecated (urls.py)

Keep also in mind that in urls.py patterns are deprecated. New urlpatterns is array and not a function.

django embed_code template does not exist

Embed_video plugin for Django requires

'APP_DIR':True, # setting inside the TEMPLATES variable

That will fix the embed_video/embed_code.html template cannot be found in templates error reported by Django

Newest from this category: