Skip to main content

A Django form widget implementing intl-tel-input.

Project description

A Django form widget based on the jQuery plugin intl-tel-input.

This is a new package, so it doesn’t implement all the features of intl-tel-input. However, it has been stable in testing, so if you’re still down…

Installation

Install from PyPI.

pip install django-intl-tel-input

Add intl-tel-input to your INSTALLED_APPS, so Django can find the init script.

...
INSTALLED_APPS += ('intl_tel_input',)
...

Usage

Simply add IntlTelInputWidget to your form field.

from intl_tel_input.widgets import IntlTelInputWidget

class MyForm(forms.ModelForm):
    class Meta:
        model = MyModel
        fields = ['foo', 'bar']
        widgets = {
            'bar': IntlTelInputWidget()
        }
...

If you have included jQuery at the end of your document, then don’t forget to update the template when this widget appears with a {{ form.media.js }}. Put it in a block that allows it to come after jQuery.

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-intl-tel-input-0.1.0.zip (7.4 kB view details)

Uploaded Source

File details

Details for the file django-intl-tel-input-0.1.0.zip.

File metadata

File hashes

Hashes for django-intl-tel-input-0.1.0.zip
Algorithm Hash digest
SHA256 6b7790d0023b599e855268cd2a3f9a369e401a821fe7301b60633b41ecc6ce91
MD5 c26da7bed2abe285cbf0dfe19bd5a960
BLAKE2b-256 f9857684465ae14adb07f99a0d1db2902e9aa0e5772d87603a795d01a4a92495

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