From ab68444e76598cf1b91c587e06ce31409c4a0e75 Mon Sep 17 00:00:00 2001 From: Drew Hubl Date: Wed, 3 Feb 2016 00:48:39 -0700 Subject: [PATCH 1/2] Django 1.9 compatibility for the csrf context processor --- silk/views/profiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silk/views/profiling.py b/silk/views/profiling.py index bb39de97..637b009d 100644 --- a/silk/views/profiling.py +++ b/silk/views/profiling.py @@ -1,4 +1,4 @@ -from django.core.context_processors import csrf +from django.template.context_processors import csrf from django.db.models import Count, Sum from django.shortcuts import render_to_response from django.utils.decorators import method_decorator From b86da0123e04ca9319f7323ef98a81455a3b23b5 Mon Sep 17 00:00:00 2001 From: Drew Hubl Date: Wed, 3 Feb 2016 00:52:55 -0700 Subject: [PATCH 2/2] Add reverse compatibility for Django < 1.9 --- silk/views/profiling.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/silk/views/profiling.py b/silk/views/profiling.py index 637b009d..bba1c4f9 100644 --- a/silk/views/profiling.py +++ b/silk/views/profiling.py @@ -1,4 +1,7 @@ -from django.template.context_processors import csrf +try: + from django.template.context_processors import csrf +except ImportError: + from django.core.context_processors import csrf from django.db.models import Count, Sum from django.shortcuts import render_to_response from django.utils.decorators import method_decorator