Django Form Field to support US or International phone numbers

djangodjango-forms

I need a Django Form Field to support US or International phone numbers. Does one exist? How could you validate US phone #'s or int'l ones.

Best Solution

How about:

https://github.com/stefanfoulis/django-phonenumber-field

Explaination From the site:

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

from phonenumber_field.modelfields import PhoneNumberField
class MyModel(models.Model):
    name = models.CharField(max_length=255)
    phone_number = PhoneNumberField()
    fax_number = PhoneNumberField(null=True, blank=True)