Skip to main content
https://travis-ci.org/stinovlas/django-lang-switch.svg?branch=devel https://codecov.io/gh/stinovlas/django-lang-switch/branch/devel/graph/badge.svg https://img.shields.io/pypi/v/django-lang-switch.svg https://img.shields.io/pypi/pyversions/django-lang-switch.svg https://img.shields.io/pypi/djversions/django-lang-switch.svg

Language switch for Django.

Installation

You can install django-lang-switch from PyPi:

$ pip install django-lang-switch

Configuration

You need to add django_lang_switch.apps.DjangoLangSwitchConfig into your INSTALLED_APPS setting. If you want to add enable language switch in django admin site, you have to add it before django.contrib.admin. Otherwise, you need to put django.contrib.admin first. If you don’t use django admin site, the order does not matter.

If you tweaked the admin/base_site.html template yourself, put this application after yours and use the template tag as described below.

You also need to include django-lang-switch urls to your ROOT_URLCONF. Example:

from django.urls import include, path

urlpatterns = [
    ...
    path('django_lang_switch/', include('django_lang_switch.urls')),
]

You can of course change the path to suit your needs.

Usage

If you just want to add language switch to django admin site, add this application to your INSTALLED_APPS as described above and you are done.

If you want to use the same switch elsewhere, add template tage lang_switch_dropdown to your template. Don’t forget to load lang_switch tag collection to your template. Example:

{% extends myapp/base_site.html %}
{% load lang_switch %}
<div id="header">
    Welcome to MyApp!
    <div class="right">
        {% lang_switch_dropdown %}
    </div>
</div>

Styling

Language switch in django admin site is already styled to fit the default design. If you want to style the lang switch yourselves, you may set css for the div.lang-switch element and its descendants.

Metadata

Release files for django-lang-switch 0.3

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-lang-switch 0.3
File Size Uploaded Provenance
django-lang-switch-0.3.tar.gz 18.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-lang-switch 0.3
File Interpreter ABI Platform
django_lang_switch-0.3-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / django-lang-switch-0.3.tar.gz

Download URL django-lang-switch-0.3.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
15c8d3cfff476a05fcd5036ca17837711cf5d4628882fa7eeb052e0d0bfaa04d
BLAKE2b-256 checksum
How to use checksums
4a07e56deda6bfacf5c9bd3336811064b1769142a3375ad062d58a6b3f0e4059
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/3.6.5

Release files / django_lang_switch-0.3-py3-none-any.whl

Download URL django_lang_switch-0.3-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
290c423fe04a84d0f1750178131328c780f904bdf7a59dd97bc166e9eee7d3dd
BLAKE2b-256 checksum
How to use checksums
f12b07cc6dad7e9401d18c609cd9730a2a54189edbc86801ad1381d4e8bd5ec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/3.6.5

Security for django-lang-switch 0.3

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.

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

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files No 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