Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: develop

This branch is 93 commits behind stefanfoulis:develop

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
phonenumber_field
.gitignore
LICENSE
MANIFEST.in
README.rst
setup.py

README.rst

django-phonenumber-field

A international phone number field for django that uses http://pypi.python.org/pypi/phonenumbers for validation .

Installation

pip install django-phonenumber-field

Basic usage

Use it like any regular model field:

class MyModel(models.Model):
    name = models.CharField(max_length=255)
    phone_number = PhoneNumberField()

PhoneNumberField will always represent the number as a string of an international phonenumber in the database. E.g +41524204242.

The object returned is not just a plain String. It is a PhoneNumber object. Currently it is necessary to always use the international format when entering data.

Future versions of django-phonenumber-field may provide custom special widgets that support more custom formatting.

Something went wrong with that request. Please try again.