Skip to main content

django_languageselect

PyPI PyPI

Simple language select as custom template tag

Requirements

  • "django.middleware.locale.LocaleMiddleware" in MIDDLEWARE_CLASSES / MIDDLEWARE
  • "django.core.context_processors.request" in TEMPLATE_CONTEXT_PROCESSORS / TEMPLATES['OPTIONS']['context_processors']

Usage

To use django_languageselect in a project, add it to INSTALLED_APPS

INSTALLED_APPS = [
    *INSTALLED_APPS,
    "django_languageselect",
]

Then add its endpoint to your urls.py. It's important to keep the languageselect_index name when using the provided template tag!

from django.urls import path

from django_languageselect.views import IndexView

urlpatterns = [
    path("languageselect", IndexView.as_view(), name="languageselect_index"),
]

Use the languageselect template tag where you wish to show the language selection:

{% load languageselect %}

{% languageselect %}

This will render all languages in your LANGUAGES setting to select from.

Parameters

  • language is the only required parameter expecting a two-letter ISO 639 language code.
  • next - optionally pass the URL to redirect to after the language has been changed. The template tag redirects to the current URL.

Customization

Feel free to use your own template, just add languageselect/layer.html to the template folder of an app that is earlier in your INSTALLED_APPS than django_languageselect.

Tests

Tests will be automatically run by travis on commit to master.

They can also be executed locally using docker-compose by running docker-compose up

Making a new release

This project makes use of RegioHelden's reusable GitHub workflows.
Make a new release by manually triggering the Open release PR workflow.

Metadata

Release files for django-languageselect 8.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-languageselect 8.1.0
File Size Uploaded Provenance
django_languageselect-8.1.0.tar.gz 8.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-languageselect 8.1.0
File Interpreter ABI Platform
django_languageselect-8.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.0 kB

Release files / django_languageselect-8.1.0.tar.gz

Download URL django_languageselect-8.1.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b03413c6da79513aab46a1a18aeb83e39c0115ce040c64ea16457098f939c537
BLAKE2b-256 checksum
How to use checksums
1f54526a1a21a20b2222c250855bc9aa33cb82d4984deed013163c7f88d74afe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / django_languageselect-8.1.0-py3-none-any.whl

Download URL django_languageselect-8.1.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
388a212a721299f7a0fd97ccbbfa48070c4ee0a86990f167ba39ecea5f9ff3c7
BLAKE2b-256 checksum
How to use checksums
7104d2e3c76446f80ae1ac8d7c9776f645cb88d17bc10d24802d73f570109f0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for django-languageselect 8.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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