Skip to main content

A pluggable django app that provides a comprehensive language choices field

Project description

Language Field for Django apps. Includes all language choices from the IANA Language Subtag Registry.

Included is:

  • LanguageField, a model field

  • LanguageField, a form field (Not yet implemented)

  • regenerate.py, a script to parse the latest language list from IANA

Installation

pip install django-language-field

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

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

Internally, LanguageField is based upon CharField and by default represents the as a string.

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-field-0.0.3.tar.gz (69.5 kB view details)

Uploaded Source

File details

Details for the file django-language-field-0.0.3.tar.gz.

File metadata

File hashes

Hashes for django-language-field-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8836a6a1345d8e0f2181ab39a49ced7f810c69eb717948a45daf0779182fe8dc
MD5 c6837adf03aa832962f8db5caabce51b
BLAKE2b-256 e5793277312e90af738d26a3ca1efa82cea9a7dbb83772e06f9e1536ae90812e

See more details on using hashes here.

Supported by

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