Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

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.

Files for django-intl-tel-input, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django-intl-tel-input-0.1.0.zip (7.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page