# 🕿 django-phonenumber-field 🕿

A Django library which interfaces with python-phonenumbers to validate, pretty print and convert phone numbers. The python-phonenumbers library is a port of Google’s libphonenumber library, which powers Android’s phone number handling.

# Installation

## Choosing a phonenumbers provider

The python-phonenumbers library comes in two flavors:

    # Installs phonenumbers minimal metadata
    pip install "django-phonenumber-field[phonenumberslite]"

    # Installs phonenumbers extended features (e.g. geocoding)
    pip install "django-phonenumber-field[phonenumbers]"

## Setup

Add `phonenumber_field` to the list of the installed apps in your `settings.py` file `INSTALLED_APPS`:

    INSTALLED_APPS = [
        # Other apps…
        "phonenumber_field",
    ]

Contents:

- Handling phone numbers
  - About phone numbers extensions
- The PhoneNumber wrapper
  - `PhoneNumber`
  - Usage
- Model field
  - `PhoneNumberField`
  - Usage
- Form fields
  - `PhoneNumberField`
  - `SplitPhoneNumberField`
  - Widgets
- Serializer field
  - `PhoneNumberField`
  - Usage
- Validator
  - `validate_international_phonenumber()`
- Settings
  - Phone number format choices
  - `PHONENUMBER_DB_FORMAT`
  - `PHONENUMBER_DEFAULT_FORMAT`
  - `PHONENUMBER_DEFAULT_REGION`