Skip to main content

django-admin-translated-urls

Build status PyPI version PyPI - Python Version PyPI - Django Version Downloads

The Django admin's URLs in the active language: its apps', models' and pages' names, translated.

Django's Translated
English /admin/scheduling/appointment/3/change/ /admin/scheduling/appointments/3/change/
Spanish /es/admin/scheduling/appointment/3/change/ /es/admin/agenda/citas/3/modificar/
  • An app's path: its verbose_name; a model's: its verbose_name_plural; slugified, in ASCII when it can be (Categorías: categorias).
  • Its pages' words (add, change, delete, history, and a user's password): translated by the package (Spanish, French, Italian, German and Portuguese so far), and yours (url_segments).
  • The URL names stay Django's: reverse("admin:app_model_change", …), templates and other packages work as always, in the active language.
  • Django's paths redirect to the translated ones: links saved before still work.
  • Paths fixed by hand, so that renaming a model doesn't change its URLs.
  • A system check for two apps, or two models, with the same path in some language.

Only Django: any AdminSite (Django's, Unfold's, your own).

Install

pip install django-admin-translated-urls
INSTALLED_APPS = [
    ...,
    "django_admin_translated_urls",  # Its translations of the pages' words.
]

Usage

Your admin site, with its mixin:

# myproject/admin.py
from django.contrib import admin
from django_admin_translated_urls import TranslatedURLsMixin


class ProjectAdminSite(TranslatedURLsMixin, admin.AdminSite):
    pass


admin_site = ProjectAdminSite(name="admin")

Or TranslatedURLsAdminSite, as the default site (admin.site, and @admin.register):

# myproject/apps.py
from django.contrib.admin.apps import AdminConfig


class ProjectAdminConfig(AdminConfig):
    default_site = "django_admin_translated_urls.TranslatedURLsAdminSite"
INSTALLED_APPS = ["myproject.apps.ProjectAdminConfig", ...]  # For "django.contrib.admin".

Its URLs in each language with i18n_patterns:

from django.conf.urls.i18n import i18n_patterns
from django.urls import path

urlpatterns = i18n_patterns(
    path("admin/", admin_site.urls),
    prefix_default_language=False,  # /admin/ in LANGUAGE_CODE's, /en/admin/…
)

Without i18n_patterns, they're in LANGUAGE_CODE's: an admin in one language that isn't English.

Your models' and apps' names need their translations, as for the rest of the admin (gettext_lazy, makemessages).

Fixing a path

By default, a path follows its name: renaming a model's verbose_name_plural changes its URLs (the old ones redirect only if they're Django's). To keep them, fix them, translatable:

from django.utils.translation import gettext_lazy as _


@admin.register(Appointment, site=admin_site)
class AppointmentAdmin(admin.ModelAdmin):
    url_slug = _("appointments")


class SchedulingConfig(AppConfig):
    name = "scheduling"
    verbose_name = _("Diary")
    url_slug = _("scheduling")

An app's, from the site too: app_url_slugs = {"scheduling": _("agenda")}.

Your own pages

A model admin's own pages (get_urls()) keep their paths, unless their words are in its url_segments:

from django.utils.translation import pgettext_lazy


class AppointmentAdmin(admin.ModelAdmin):
    url_segments = {"calendar": pgettext_lazy("admin URL", "calendar")}

    def get_urls(self):
        return [
            path("calendar/", self.admin_site.admin_view(self.calendar_view), name="…"),
            *super().get_urls(),
        ]

calendar/: /es/admin/agenda/citas/calendario/. A word is a whole segment of a path()'s route (not a regular expression's); the site's url_segments are every model's (URL_SEGMENTS and yours, to add one).

Options

Of the site
url_segments Every model's pages' words, translated (URL_SEGMENTS).
app_url_slugs An app's path, by its label.
redirect_untranslated_urls Django's paths redirect to theirs (True).
get_app_url_slug(app_label), get_model_url_slug(model, model_admin), get_url_segments(model_admin) To choose them otherwise.
Of a model admin
url_slug Its path, instead of its verbose_name_plural's.
url_segments Its own pages' words, translated.
Of an app
AppConfig.url_slug Its path, instead of its verbose_name's.

Checks

manage.py check, in each language of LANGUAGES:

  • admin_translated_urls.E001: two apps with the same path.
  • admin_translated_urls.E002: an app's path is the site's own (login/, logout/…).
  • admin_translated_urls.E003: two models of an app with the same path.
  • admin_translated_urls.E004: two words of a model's pages with the same path.

Compatibility

Django 4.2 to 6.1, Python 3.10 to 3.14.

License

MIT

Metadata

Release files for django-admin-translated-urls 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-admin-translated-urls 0.1.0
File Size Uploaded Provenance Actions
django_admin_translated_urls-0.1.0.tar.gz 103.1 kB With provenance Details for django_admin_translated_urls-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-admin-translated-urls 0.1.0
File Interpreter ABI Platform Actions
django_admin_translated_urls-0.1.0-py3-none-any.whl Python 3 none any Details for django_admin_translated_urls-0.1.0-py3-none-any.whl

Total release size: 118.7 kB

Release files / django_admin_translated_urls-0.1.0.tar.gz

Download URL django_admin_translated_urls-0.1.0.tar.gz
Size 103.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0860a3cc588a75c91786f73f371f6303c98d70a6398df38a110c826d7a811d77
BLAKE2b-256 checksum
How to use checksums
a96cdc5f74bc2774b617a65e9ec5bde3bfdf07119a5b42d9ea1e29759ca4b40a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / django_admin_translated_urls-0.1.0-py3-none-any.whl

Download URL django_admin_translated_urls-0.1.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7463bb565cf55a78504a467c94cce5a649ea2e6d6ef3173b4cff2feb0ed6b99d
BLAKE2b-256 checksum
How to use checksums
e936edc9e071f7a85ec0eb838b41a029255cd3b72558bf181a31066fc8bc6b53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for django-admin-translated-urls 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_admin_translated_urls-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page