Address RemovedInDjango40Warning (2)

django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

On top of that django.conf.urls.url() is deprecated in favor of
django.urls.re_path()

Since Horizon is using Django>4.0, it's highly important to cover these
issues for upcoming release.

https: //docs.djangoproject.com/en/4.0/releases/3.0/#id3
Change-Id: Ibefe848cf73a31608ce5e71f4847b741ec16f8ad
This commit is contained in:
Dmitriy Rabotyagov 2024-03-08 17:27:31 +01:00
parent 02dd3d7363
commit 2bea2114fb
45 changed files with 98 additions and 99 deletions

View File

@ -19,7 +19,7 @@ import requests
from urllib.parse import urljoin from urllib.parse import urljoin
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon.utils import functions as utils from horizon.utils import functions as utils

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
from django.forms import ValidationError from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import forms from horizon import forms
from horizon import messages from horizon import messages

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.conf.urls import url from django.urls import re_path
from adjutant_ui.content.email import views from adjutant_ui.content.email import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.EmailView.as_view(), name='index') re_path(r'^$', views.EmailView.as_view(), name='index')
] ]

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import forms from horizon import forms

View File

@ -15,7 +15,7 @@
from django.conf import settings from django.conf import settings
from django import forms from django import forms
from django import http from django import http
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import forms as hforms from horizon import forms as hforms
from horizon.utils import functions as utils from horizon.utils import functions as utils

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.conf.urls import url from django.urls import re_path
from adjutant_ui.content.forgot_password import views from adjutant_ui.content.forgot_password import views
# NOTE(adriant): These urls are registered in the project_users urls.py file. # NOTE(adriant): These urls are registered in the project_users urls.py file.
urlpatterns = [ urlpatterns = [
url(r'^$', views.ForgotPasswordView.as_view(), name='forgot_index'), re_path(r'^$', views.ForgotPasswordView.as_view(), name='forgot_index'),
url(r'^sent/?$', views.password_sent_view, name='forgot_sent'), re_path(r'^sent/?$', views.password_sent_view, name='forgot_sent'),
] ]

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
@ -28,7 +28,7 @@ class AcknowlegeNotifcation(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Acknowlege Notification", u"Acknowlege Notification",
u"Acknowlege Notifications", u"Acknowlege Notifications",
count count
@ -36,7 +36,7 @@ class AcknowlegeNotifcation(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Acknowleged Notification", u"Acknowleged Notification",
u"Acknowleged Notifications", u"Acknowleged Notifications",
count count

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import tabs from horizon import tabs

View File

@ -13,13 +13,13 @@
# limitations under the License. # limitations under the License.
from django.conf.urls import url from django.urls import re_path
from adjutant_ui.content.notifications import views from adjutant_ui.content.notifications import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<notif_id>[^/]+)/$', re_path(r'^(?P<notif_id>[^/]+)/$',
views.NotificationDetailView.as_view(), name='detail'), views.NotificationDetailView.as_view(), name='detail'),
] ]

View File

@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import tabs from horizon import tabs

View File

@ -14,7 +14,7 @@
from django.conf import settings from django.conf import settings
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -14,8 +14,8 @@
from collections import defaultdict from collections import defaultdict
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
@ -32,7 +32,7 @@ class InviteUser(tables.LinkAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Invited User", u"Invited User",
u"Invited Users", u"Invited Users",
count count
@ -44,7 +44,7 @@ class ResendInvitation(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Resend Invitation", u"Resend Invitation",
u"Resend Invitations", u"Resend Invitations",
count count
@ -52,7 +52,7 @@ class ResendInvitation(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Invitation re-sent", u"Invitation re-sent",
u"Invitations re-sent", u"Invitations re-sent",
count count
@ -85,7 +85,7 @@ class RevokeUser(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Revoke User", u"Revoke User",
u"Revoke Users", u"Revoke Users",
count count
@ -93,7 +93,7 @@ class RevokeUser(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Revoked User", u"Revoked User",
u"Revoked Users", u"Revoked Users",
count count

View File

@ -12,15 +12,15 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.conf.urls import url from django.urls import re_path
from adjutant_ui.content.project_users import views from adjutant_ui.content.project_users import views
urlpatterns = [ urlpatterns = [
url(r'^invite/$', views.InviteUserView.as_view(), name='invite'), re_path(r'^invite/$', views.InviteUserView.as_view(), name='invite'),
url(r'^(?P<user_id>[^/]+)/update/$', re_path(r'^(?P<user_id>[^/]+)/update/$',
views.UpdateUserView.as_view(), views.UpdateUserView.as_view(),
name='update'), name='update'),
url(r'^$', views.UsersView.as_view(), name='index') re_path(r'^$', views.UsersView.as_view(), name='index')
] ]

View File

@ -14,7 +14,7 @@
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -15,7 +15,7 @@
import logging import logging
from django.urls import reverse # noqa from django.urls import reverse # noqa
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -14,8 +14,8 @@
import json import json
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
@ -61,7 +61,7 @@ class CancelQuotaTask(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Cancel Quota Update", u"Cancel Quota Update",
u"Cancel Quota Updates", u"Cancel Quota Updates",
count count
@ -69,7 +69,7 @@ class CancelQuotaTask(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Cancelled Quota Update", u"Cancelled Quota Update",
u"Cancelled Quota Updates", u"Cancelled Quota Updates",
count count

View File

@ -12,17 +12,17 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.conf.urls import url from django.urls import re_path
from adjutant_ui.content.quota import views from adjutant_ui.content.quota import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),
url(r'^region/(?P<region>[^/]+)$', views.RegionDetailView.as_view(), re_path(r'^region/(?P<region>[^/]+)$', views.RegionDetailView.as_view(),
name='region_detail'), name='region_detail'),
url(r'^(?P<region>[^/]+)/update$', re_path(r'^(?P<region>[^/]+)/update$',
views.RegionUpdateView.as_view(), name='update'), views.RegionUpdateView.as_view(), name='update'),
url(r'^size/(?P<size>[^/]+)$', views.QuotaSizeView.as_view(), re_path(r'^size/(?P<size>[^/]+)$', views.QuotaSizeView.as_view(),
name='size_detail'), name='size_detail'),
] ]

View File

@ -14,7 +14,7 @@
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -15,7 +15,7 @@
from django.conf import settings from django.conf import settings
from django import forms from django import forms
from django import http from django import http
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import forms as hforms from horizon import forms as hforms
from horizon.utils import functions as utils from horizon.utils import functions as utils

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.conf.urls import url from django.urls import re_path
from adjutant_ui.content.signup import views from adjutant_ui.content.signup import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.SignupFormView.as_view(), name='index'), re_path(r'^$', views.SignupFormView.as_view(), name='index'),
url(r'^submitted/?$', views.signup_sent_view, name='submitted'), re_path(r'^submitted/?$', views.signup_sent_view, name='submitted'),
] ]

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import forms from horizon import forms
from horizon import messages from horizon import messages

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
@ -26,7 +26,7 @@ class CancelTask(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Cancel Task", u"Cancel Task",
u"Cancel Tasks", u"Cancel Tasks",
count count
@ -34,7 +34,7 @@ class CancelTask(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Cancelled Task", u"Cancelled Task",
u"Cancelled Tasks", u"Cancelled Tasks",
count count
@ -61,7 +61,7 @@ class ApproveTask(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Approve Task", u"Approve Task",
u"Approve Tasks", u"Approve Tasks",
count count
@ -69,7 +69,7 @@ class ApproveTask(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Approved Task", u"Approved Task",
u"Approved Tasks", u"Approved Tasks",
count count
@ -95,7 +95,7 @@ class ReissueToken(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Reissue Token", u"Reissue Token",
u"Reissue Tokens", u"Reissue Tokens",
count count
@ -103,7 +103,7 @@ class ReissueToken(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Reissued Token", u"Reissued Token",
u"Reissued Tokens", u"Reissued Tokens",
count count
@ -128,7 +128,7 @@ class RevalidateTask(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Rerun Validation", u"Rerun Validation",
u"Rerun Validation", u"Rerun Validation",
count count
@ -136,7 +136,7 @@ class RevalidateTask(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Validation run", u"Validation run",
u"Validation run", u"Validation run",
count count
@ -162,7 +162,7 @@ class ReapproveTask(ApproveTask):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Reapprove Task", u"Reapprove Task",
u"Reapprove Tasks", u"Reapprove Tasks",
count count
@ -170,7 +170,7 @@ class ReapproveTask(ApproveTask):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Reapproved Task", u"Reapproved Task",
u"Reapproved Tasks", u"Reapproved Tasks",
count count

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import tabs from horizon import tabs

View File

@ -13,16 +13,16 @@
# limitations under the License. # limitations under the License.
from django.conf.urls import url from django.urls import re_path
from adjutant_ui.content.tasks import views from adjutant_ui.content.tasks import views
urlpatterns = [ urlpatterns = [
url(r'^(?P<task_id>[^/]+)/$', re_path(r'^(?P<task_id>[^/]+)/$',
views.TaskDetailView.as_view(), views.TaskDetailView.as_view(),
name='detail'), name='detail'),
url(r'^(?P<task_id>[^/]+)/update/$', re_path(r'^(?P<task_id>[^/]+)/update/$',
views.UpdateTaskView.as_view(), name='update'), views.UpdateTaskView.as_view(), name='update'),
url(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),
] ]

View File

@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -15,7 +15,7 @@
from django.conf import settings from django.conf import settings
from django.forms import ValidationError # noqa from django.forms import ValidationError # noqa
from django import http from django import http
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views.decorators.debug import sensitive_variables # noqa from django.views.decorators.debug import sensitive_variables # noqa
from horizon import exceptions from horizon import exceptions

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.conf.urls import url from django.urls import re_path
from adjutant_ui.content.token import views from adjutant_ui.content.token import views
urlpatterns = [ urlpatterns = [
url(r'^(?P<token>\w+)/?$', views.submit_token_router, re_path(r'^(?P<token>\w+)/?$', views.submit_token_router,
name='token_verify'), name='token_verify'),
] ]

View File

@ -15,7 +15,7 @@
from django.conf import settings from django.conf import settings
from django import http from django import http
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -1,4 +1,4 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required. # The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'access_control' PANEL_GROUP = 'access_control'

View File

@ -15,7 +15,7 @@
from django.conf import settings from django.conf import settings
from django import template from django import template
from django.utils.translation import ugettext_lazy from django.utils.translation import gettext_lazy
register = template.Library() register = template.Library()
@ -34,7 +34,7 @@ def relabel_username_field(context):
if (hasattr(settings, 'USERNAME_IS_EMAIL') and if (hasattr(settings, 'USERNAME_IS_EMAIL') and
getattr(settings, 'USERNAME_IS_EMAIL')): getattr(settings, 'USERNAME_IS_EMAIL')):
try: try:
context['form'].fields['username'].label = ugettext_lazy('Email') context['form'].fields['username'].label = gettext_lazy('Email')
except Exception: except Exception:
pass pass
return u"" return u""

View File

@ -412,7 +412,6 @@ function run_integration_tests {
function babel_extract { function babel_extract {
DOMAIN=$1 DOMAIN=$1
KEYWORDS="-k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2" KEYWORDS="-k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2"
KEYWORDS+=" -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2"
KEYWORDS+=" -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3" KEYWORDS+=" -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3"
mkdir -p locale mkdir -p locale

View File

@ -65,7 +65,7 @@ import_exceptions = collections.defaultdict,
django.conf.settings, django.conf.settings,
django.conf.urls.include, django.conf.urls.include,
django.conf.urls.patterns, django.conf.urls.patterns,
django.conf.urls.url, django.urls.re_path,
django.urls.reverse, django.urls.reverse,
django.urls.reverse_lazy, django.urls.reverse_lazy,
django.template.loader.render_to_string, django.template.loader.render_to_string,
@ -78,7 +78,7 @@ import_exceptions = collections.defaultdict,
django.utils.safestring.mark_safe, django.utils.safestring.mark_safe,
django.utils.translation.npgettext_lazy, django.utils.translation.npgettext_lazy,
django.utils.translation.pgettext_lazy, django.utils.translation.pgettext_lazy,
django.utils.translation.ugettext_lazy, django.utils.translation.gettext_lazy,
django.utils.translation.ungettext_lazy, django.utils.translation.ngettext_lazy,
operator.attrgetter, operator.attrgetter,
StringIO.StringIO StringIO.StringIO