aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/compat.py
diff options
context:
space:
mode:
Diffstat (limited to 'djangorestframework/compat.py')
-rw-r--r--djangorestframework/compat.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/djangorestframework/compat.py b/djangorestframework/compat.py
index 7690316c..b818b446 100644
--- a/djangorestframework/compat.py
+++ b/djangorestframework/compat.py
@@ -457,3 +457,11 @@ except ImportError: # python < 2.7
return decorator
unittest.skip = skip
+
+# reverse_lazy (Django 1.4 onwards)
+try:
+ from django.core.urlresolvers import reverse_lazy
+except:
+ from django.core.urlresolvers import reverse
+ from django.utils.functional import lazy
+ reverse_lazy = lazy(reverse, str)