diff --git a/modelclone/admin.py b/modelclone/admin.py index 693e0d8..88f773b 100644 --- a/modelclone/admin.py +++ b/modelclone/admin.py @@ -5,10 +5,17 @@ except ImportError: # django < 1.7 from django.contrib.admin.util import unquote -from django.conf.urls import url -from django.utils.encoding import force_text -from django.utils.translation import ugettext as _ -from django.utils.translation import ugettext_lazy as lazy +try: + from django.urls import re_path as url + from django.utils.encoding import force_str as force_text + from django.utils.translation import gettext as _ + from django.utils.translation import gettext_lazy as lazy +except ImportError: + # django < 4.0 + from django.conf.urls import url + from django.utils.encoding import force_text + from django.utils.translation import ugettext as _ + from django.utils.translation import ugettext_lazy as lazy from django.utils.html import escape from django.forms.models import model_to_dict from django.forms.formsets import all_valid