Skip to main content

A pluggable django app that provides a comprehensive language and region choices field

Project description

Language and Region Fields for Django apps. Includes all language choices from the IANA Language Subtag Registry.

Included is:

  • LanguageField, a model field

  • RegionField, a model field

Installation

pip install django-language-fields

Basic usage

Add languages to the list of the installed apps in your settings.py file:

INSTALLED_APPS = [
    ...
    'languages',
    ...
]

Then, you can use it like any regular model field:

from languages.fields import LanguageField, RegionField

class MyModel(models.Model):
    ..
    language = LanguageField()
    ..

class MyModel(models.Model):
    ..
    region = RegionField()
    ..

Internally, LanguageField and RegionField are based upon CharField and by default represented as strings.

As with CharField’s, it is discouraged to use null=True use blank=True if you want to make it a non-required field.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-language-fields-1.0.1.tar.gz (70.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_language_fields-1.0.1-py3-none-any.whl (70.9 kB view details)

Uploaded Python 3

File details

Details for the file django-language-fields-1.0.1.tar.gz.

File metadata

  • Download URL: django-language-fields-1.0.1.tar.gz
  • Upload date:
  • Size: 70.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for django-language-fields-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f03292ee7c72b0fecd91f3739ea96bc56d28c2170a35c8702f33b752fc0c2eb4
MD5 e76e35c9984885ee9ab78cb584e40a4b
BLAKE2b-256 c700e917dfebcdd32663cbeee46bde477c97aedc981311f19a94bb061ef6b2e5

See more details on using hashes here.

File details

Details for the file django_language_fields-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: django_language_fields-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 70.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for django_language_fields-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4129548b78a4c15cc0d12ed21a1d4a403ea56ca3486c319b92a1fbc0cc53f3b8
MD5 fd2a086c8ba0c60d2a7c4dcf4c6a7ddb
BLAKE2b-256 6701c8a1b377926238f39c820744be9f2bbf8a8de52246f539768ebeb9c03dc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page