Registry / devops / django-phonenumbers

django-phonenumbers

JSON →
library1.0.1pypypiunverified

A Django app that provides a phone number field for Django admin, integrating the Google libphonenumber library (via phonenumbers) for validation and formatting. Version 1.0.1 has minimal updates; the project is in maintenance mode with no recent releases.

pip install django-phonenumbers
INSTALL
IMPORT
SIG · DJANGO-PHONENUMBER
D
django-phonenumbers
devopspythonv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PhoneNumberField
from django_phonenumbers import PhoneNumberField
from phone_fields import PhoneNumberField

Define a model with a phone number field.

from phone_fields import PhoneNumberField from django.db import models class Customer(models.Model): name = models.CharField(max_length=100) phone = PhoneNumberField() def __str__(self): return self.name
Debug
Known issues
gotchaThe correct import path is from phone_fields, not from django_phonenumbers. The package name differs from the importable module.
fix
Use 'from phone_fields import PhoneNumberField' instead of 'from django_phonenumbers import ...'.
affects: All versions
gotchaThe PhoneNumberField stores values as strings in the database, not as PhoneNumber objects. When retrieving, you get a string unless you use a custom descriptor.
fix
Consider using a custom model field that deserializes to a PhoneNumber object, or manually parse the string using the phonenumbers library.
affects: All versions
deprecatedThis package has not been updated since 2018 and may have compatibility issues with newer Django versions (2.2+).
fix
Switch to django-phonenumber-field (different package) which is actively maintained and supports Django 3.x/4.x.
affects: Django >= 2.2
Upgrade
Version history
1.0.1latest on PyPI · released Aug 6, 2015
Audit
Dependencies
phonenumbersrequiredCore dependency for phone number validation and formatting.
phonenumbersliteoptionalAlternative lightweight version of phonenumbers with reduced metadata.
Agent activity
5 hits · last 30 days
node
4
Resources
django-phonenumbers — pip install django-phonenumbers · libregistry