-from django import VERSION
-
-
-try:
- from urllib.parse import urlparse, parse_qsl, parse_qs
- from urllib.request import install_opener
-except:
- from urlparse import urlparse, parse_qsl, parse_qs
- from urllib2 import install_opener
-
-
-if VERSION >= (1, 10):
- from django.urls import reverse
- user_is_anonymous = lambda user: user.is_anonymous
-else:
- from django.core.urlresolvers import reverse
- user_is_anonymous = lambda user: user.is_anonymous()