Skip to content

Instantly share code, notes, and snippets.

@emrementese
Last active March 30, 2025 06:47
Show Gist options
  • Save emrementese/d9e2f7c4951feb95fe4bc621b184114d to your computer and use it in GitHub Desktop.
Save emrementese/d9e2f7c4951feb95fe4bc621b184114d to your computer and use it in GitHub Desktop.
GSoC-2025-Django-Proposal

GSoC 2025 - Django Proposal: Phone Field

Project Overview

1. Project Title

  • Title: Add PhoneNumberField/PhoneField to Django Core
  • Difficulty: Medium
  • Size: Estimated hour for scope - 350hrs
  • Potential Mentors: ---
  • Key Skills: Django Models, Django Core, Fields, Django Forms etc.

1.1 Abstract

  • This project proposes the addition of a new PhoneNumberField to Django’s model field options. The goal is to provide a built-in, flexible and internationalized solution for phone number storage, validation, and rendering, reducing reliance on external packages for a common use case.

1.2 Which Category ?

  • Work on Django itself ( ORM, forms, etc,)
  • Work on libraries that supplement or add new features to Django to ease development

1.3 Related third party libs

2. Motivation

In modern web development, phone numbers have become a first-class citizen in user models — often standing alongside or even replacing email addresses in authentication, communication, and user verification workflows.

While Django offers an EmailField out of the box, there is currently no built-in PhoneNumberField, despite the clear and growing demand from the developer community.

Key reasons why this feature is needed: • Phone numbers are increasingly used in account creation, password reset, and login flows. • Applications today often require SMS-based two-factor authentication, phone call verifications, or integrations with messaging platforms like WhatsApp. • A PhoneNumberField is as essential as an EmailField in many modern user models.

Evidence of strong community demand: • Third-party packages like django-phonenumber-field have 1.5K+ stars and wide adoption. • Developers frequently request this feature in forums and issues. • Existing solutions are helpful, but introducing this natively into Django would: • Reduce dependency on external libraries • Improve consistency and developer experience • Align with Django’s “batteries included” philosophy

By adding a robust PhoneNumberField to Django core, we provide a feature that: • Fulfills a common and practical need, • Helps thousands of developers avoid boilerplate or third-party workarounds, • And supports more secure and flexible user identity models.

3. Related Issues

I would also like to list the issues opened regarding this project on different platforms below:

4. Proposal

The general goal is to add a built-in phone number field to the Django core. The phone number field should handle input and validation in compliance with international standards. At this point, integration can be implemented in line with Google’s libphonenumber library and its Python port, python-phonenumbers, similar to what the django-phonenumber-field package does.

However, this proposal does not aim to directly full integrate the django-phonenumber-field package into Django core. Instead, it aims for a clean and well-integrated implementation, taking into account the open issues and limitations of the existing third-party package.

  • Also this new field can be added to the built-in "AbstractBaseUser"

5. Example usage (Goal)

from django.db import models
from django.contrib.auth.models import AbstractBaseUser

class User(AbstractBaseUser):
    
    phone = models.PhoneField() # sample: 1
    phone = models.PhoneNumberField() # sample: 2

6. About Me

I hold a Bachelor’s degree in Electrical and Electronics Engineering and have been actively working in the software industry for around six years. During most of this time, I have worked as a backend developer, with Django being one of the primary technologies I’ve used. Software development is not just my profession but also my passion. I’m eager to contribute to open-source platforms like Django, which have provided me with both professional growth and income opportunities, in order to help them grow stronger and continue empowering developers like myself.

Emre MENTEŞE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment