diff --git a/README.md b/README.md index 46ac5c69..b6bcf473 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ Add `pinax.notifications.urls` to your project urlpatterns: ```python urlpatterns = [ # other urls - url(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")), + re_path(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")), ] ``` @@ -139,7 +139,7 @@ One way to create notice types is using a custom `AppConfig`. Here is an example # myapp/signals/handlers.py from django.conf import settings -from django.utils.translation import ugettext_noop as _ +from django.utils.translation import gettext_noop as _ def create_notice_types(sender, **kwargs): if "pinax.notifications" in settings.INSTALLED_APPS: @@ -155,7 +155,7 @@ Notice that the code is wrapped in a conditional clause so if `pinax-notifications` is not installed, your app will proceed anyway. Note that the display and description arguments are marked for translation by -using ugettext_noop. That will enable you to use Django's makemessages +using gettext_noop. That will enable you to use Django's makemessages management command and use `pinax-notifications` i18n capabilities. ```python @@ -472,14 +472,14 @@ Then override the url: ```python # urls.py -from django.conf.urls import url +from django.urls import re_path from .views import TeamNoticeSettingsView urlpatterns = [ # other urls - url(r"^notifications/settings/$", TeamNoticeSettingsView.as_view(), name="notification_notice_settings"), + re_path(r"^notifications/settings/$", TeamNoticeSettingsView.as_view(), name="notification_notice_settings"), ] ``` diff --git a/pinax/notifications/apps.py b/pinax/notifications/apps.py index ea8b6ae0..cf8bebab 100644 --- a/pinax/notifications/apps.py +++ b/pinax/notifications/apps.py @@ -1,5 +1,5 @@ from django.apps import AppConfig as BaseAppConfig -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class AppConfig(BaseAppConfig): diff --git a/pinax/notifications/backends/email.py b/pinax/notifications/backends/email.py index c5801b73..f46fe35a 100644 --- a/pinax/notifications/backends/email.py +++ b/pinax/notifications/backends/email.py @@ -1,7 +1,7 @@ from django.conf import settings from django.core.mail import send_mail from django.template.loader import render_to_string -from django.utils.translation import ugettext +from django.utils.translation import gettext from .base import BaseBackend @@ -22,7 +22,7 @@ def deliver(self, recipient, sender, notice_type, extra_context): context.update({ "recipient": recipient, "sender": sender, - "notice": ugettext(notice_type.display), + "notice": gettext(notice_type.display), }) context.update(extra_context) diff --git a/pinax/notifications/models.py b/pinax/notifications/models.py index 0bed5943..22173636 100644 --- a/pinax/notifications/models.py +++ b/pinax/notifications/models.py @@ -7,7 +7,7 @@ from django.db import models from django.db.models.query import QuerySet from django.utils.translation import activate, get_language -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from .conf import settings from .hooks import hookset diff --git a/pinax/notifications/tests/urls.py b/pinax/notifications/tests/urls.py index 44c67c85..332bea06 100644 --- a/pinax/notifications/tests/urls.py +++ b/pinax/notifications/tests/urls.py @@ -1,5 +1,5 @@ -from django.conf.urls import include, url +from django.urls import include, re_path urlpatterns = [ - url(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")), + re_path(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")), ] diff --git a/pinax/notifications/urls.py b/pinax/notifications/urls.py index 4520eb46..57c3a316 100644 --- a/pinax/notifications/urls.py +++ b/pinax/notifications/urls.py @@ -1,9 +1,9 @@ -from django.conf.urls import url +from django.urls import re_path from .views import NoticeSettingsView app_name = "pinax_notifications" urlpatterns = [ - url(r"^settings/$", NoticeSettingsView.as_view(), name="notice_settings"), + re_path(r"^settings/$", NoticeSettingsView.as_view(), name="notice_settings"), ]