Fixes for Python 3 and Django 2.0

This commit is contained in:
Garret Wassermann
2018-03-04 01:52:58 -05:00
parent 283f5e9cec
commit 3c456873a5
3 changed files with 16 additions and 4 deletions

View File

@ -7,7 +7,12 @@ views/public.py - All public facing views, eg non-staff (no authentication
required) views.
"""
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
try:
# Django 2.0+
from django.urls import reverse
except ImportError:
# Django < 2
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from django.utils.http import urlquote