First, install "django-phonenumber-field" package with the command below:
pip install django-phonenumber-field[phonenumbers]
Then, set "phonenumber_field" to INSTALLED_APPS in "settings.py":
# "settings.py"
INSTALLED_APPS = [
...
"phonenumber_field",
...
]
Then, set a field with "PhoneNumberField()" in "models.py":
# "models.py"
from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
class Contact(models.Model):
phone = PhoneNumberField()
Then, register "Contact" in "admin.py":
# "admin.py"
from django.contrib import admin
from .models import Contact
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
pass
Then, run the command below:
python manage.py makemigrations && python manage.py migrate
Now, the field for a phone number is created as shown below:

In addition, assign the widget "PhoneNumberPrefixWidget()" to the field in a custom form and assign the custom form to the admin as shown below:
# "admin.py"
from django.contrib import admin
from .models import Contact
from django import forms
from phonenumber_field.widgets import PhoneNumberPrefixWidget
class ContactForm(forms.ModelForm):
class Meta:
widgets = {
'phone': PhoneNumberPrefixWidget(),
}
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
form = ContactForm
Now, with country codes, the field for a phone number is created

And, you can set an initial country code like initial='US' to "PhoneNumberPrefixWidget()" as shown below. *Initial country code must be uppercase:
# "admin.py"
from django.contrib import admin
from .models import Contact
from django import forms
from phonenumber_field.widgets import PhoneNumberPrefixWidget
class ContactForm(forms.ModelForm):
class Meta:
widgets = { # Here
'phone': PhoneNumberPrefixWidget(initial='US'),
}
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
form = ContactForm
Now, with the initial country code "US" selected, the field for a phone number is created:

You can also set an initial country code with "PHONENUMBER_DEFAULT_REGION" in "settings.py" as shown below but I recommand to set an initial country code with initial='US' to "PhoneNumberPrefixWidget()" as I've done above because using "PHONENUMBER_DEFAULT_REGION" sometimes doesn't display saved phone numbers in Django Admin:
# "settings.py"
PHONENUMBER_DEFAULT_REGION = "US"