5👍
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)
3👍
Check out Django’s “local flavor packages”: http://docs.djangoproject.com/en/dev/ref/contrib/localflavor/#united-states-of-america-us
- [Django]-Django-uploadify-s3 and HTTP 403 Error
- [Django]-Django: export current queryset to csv by button click in browser
- [Django]-Best practices: Good idea to create a new table for every user?
1👍
lazerscience’s answer is correct, but I want to give an alternative as you also asked for International Phone Numbers.
Just use a RegexField with a regular expression for the format you want, for the most types of phone numbers this can easily be googled. In fact, many local flavor fields are based on a RegexField.
But use the Local Flavor packages if it suits all your needs!
- [Django]-Django on Heroku, url template tag causes 'ParseResult' object not callable
- [Django]-Django handler404 not called on raise Http404()
- [Django]-Django-nginx-gunicorn – not working
Source:stackexchange.com