A django model and form field for normalised phone numbers using python-phonenumbers

Overview

django-phonenumber-field

https://travis-ci.org/stefanfoulis/django-phonenumber-field.svg?branch=master

A Django library which interfaces with python-phonenumbers to validate, pretty print and convert phone numbers. python-phonenumbers is a port of Google's libphonenumber library, which powers Android's phone number handling.

Included are:

  • PhoneNumber, a pythonic wrapper around python-phonenumbers' PhoneNumber class
  • PhoneNumberField, a model field
  • PhoneNumberField, a form field
  • PhoneNumberField, a serializer field
  • PhoneNumberPrefixWidget, a form widget for selecting a region code and entering a national number. Requires the Babel package be installed.
  • PhoneNumberInternationalFallbackWidget, a form widget that uses national numbers unless an international number is entered. A PHONENUMBER_DEFAULT_REGION setting needs to be added to your Django settings in order to know which national number format to recognize. The setting is a string containing an ISO-3166-1 two-letter country code.

Installation

pip install django-phonenumber-field[phonenumbers]

As an alternative to the phonenumbers package, it is possible to install the phonenumberslite package which has a lower memory footprint.

pip install django-phonenumber-field[phonenumberslite]

Basic usage

First, add phonenumber_field to the list of the installed apps in your settings.py file:

INSTALLED_APPS = [
    ...
    'phonenumber_field',
    ...
]

Then, you can use it like any regular model field:

from phonenumber_field.modelfields import PhoneNumberField

class MyModel(models.Model):
    name = models.CharField(max_length=255)
    phone_number = PhoneNumberField()
    fax_number = PhoneNumberField(blank=True)

Internally, PhoneNumberField is based upon CharField and by default represents the number as a string of an international phonenumber in the database (e.g '+41524204242').

Representation can be set by PHONENUMBER_DB_FORMAT variable in django settings module. This variable must be one of 'E164', 'INTERNATIONAL', 'NATIONAL' or 'RFC3966'. Recommended is one of the globally meaningful formats 'E164', 'INTERNATIONAL' or 'RFC3966'. 'NATIONAL' format require to set up PHONENUMBER_DEFAULT_REGION variable.

The object returned is a PhoneNumber instance, not a string. If strings are used to initialize it, e.g. via MyModel(phone_number='+41524204242') or form handling, it has to be a phone number with country code.

Running tests

tox needs to be installed. To run the whole test matrix with the locally available Python interpreters and generate a combined coverage report:

tox

run a specific combination:

tox -e py36-djmaster,py39-djmaster
Comments
  • Create a new 0.7 version?

    Create a new 0.7 version?

    The 0.6 version has some bugs (like'NoneType' object has no attribute 'as_e164') which are resolved in merges there after, but difficult to get the latest version from pip.

    opened by devangmundhra 15
  • Save should not raise `ValueError` on invalid phonenumber

    Save should not raise `ValueError` on invalid phonenumber

    Save() should only raise ValueErrors when the data to be stored is incompatible with the raw field data. A string that contains data that is not a valid phone number doesn't count as invalid, and should be checked in clean(), not in save().

    closes #334

    opened by karolyi 14
  • Widget initial by label, not value (country code US does not initialize as United States)

    Widget initial by label, not value (country code US does not initialize as United States)

    I am trying to set the initial value of the Prefix select, the issue is that when using initial='US' the select defaults to "American Samoa" because it is the first item in the list with the value of "+1", rather than "United States".

    Is there a way to set the initial value based on the label rather than the value because of the duplicate country codes?

    opened by nwaxiomatic 14
  • Serialization

    Serialization

    The modelfield is not JSON serializable out fo the box. Custom solutions have to be used to make it so or else it raises an error as below šŸ‘ :

      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 179, in default
        raise TypeError(f'Object of type {o.__class__.__name__} '
    TypeError: Object of type PhoneNumber is not JSON serializable
    

    Suggest it is implemented out of the box for use with Django Rest Framework.

    opened by jerryshikanga 13
  • Default Country Code?

    Default Country Code?

    Is there a way append a default country code? If no Country code is typed? I am thinking along the lines of, mobile = PhoneNumberField(required=True, country='india') or mobile = PhoneNumberField(required=True, country='+91') My users are not smart enough to add their own country code, sometimes. It raises few errors. I currently tell them add the country code in a html placeholder.

    opened by CT83 12
  • Add a new widget for smart switching between national and international formats

    Add a new widget for smart switching between national and international formats

    Currently, if using PHONENUMBER_DEFAULT_FORMAT = 'NATIONAL' numbers that are entered in international format lose their country information on loading the form, meaning they cannot be validated. This widget checks if the number provided is in the expected region and renders it in national format if so, or international if there's a mismatch.

    opened by MatthewWilkes 11
  • Several improvements

    Several improvements

    I made several little tweaks to the field. There were a few subtle bugs introduced in recent commits, which should be fixed. I also gave the test suite some love. Two features were added; specificing PHONENUMBER_DEFAULT_FORMAT (instead of defaulting to E164), and hinting at the region when using parse_string.

    I've added a note on null=True being discouraged for usage with the PhoneNumberField. As with CharFields, in most cases one doesn't want two different "empty" statuses, '' and None.

    I suggest making PhoneNumberField stricter, only accepting valid phone numbers by default. But that's a backwards-incompatible change and should be discussed.

    opened by maiksprenger 11
  • Normal Nigerian number should be 10 digits long excluding country code

    Normal Nigerian number should be 10 digits long excluding country code

    I am currently faced with the issue of validating Nigerian numbers. Normally, a typical Nigerian number is +234 XXX XXX XXXX or 0XX XXX XXX XX and when I test the formatted number against this regex r'^(0|\+234)[0-9]{10}', I always get this assertion error

    AssertionError: Lists differ: [ErrorDetail(string=*Enter a valid phone number.', code='invalid')] != ['... phone number cannot be the same as your phone number.']
    

    My settings.py has PHONENUMBER_DEFAULT_REGION = 'NG', and I tested my regex against the return value of phonenumbers.format_number( phonenumbers.parse(str(value), settings.PHONENUMBER_DEFAULT_REGION), phonenumbers.PhoneNumberFormat.E164 )

    opened by Sirneij 10
  • Can not install `django-phonenumber-field` properly with `pipenv`

    Can not install `django-phonenumber-field` properly with `pipenv`

    Original issue: https://github.com/pypa/pipenv/issues/1322

    When installing django-phonenumber-field strange issue happens. When running direct pipenv install django-phonenumber-field everything works fine. But when another developer tries to install the requirements from Pipfile, for some reason package phonenumberslite is missing.

    I feel like this line in setup.py is the cause of this issue: https://github.com/stefanfoulis/django-phonenumber-field/blob/master/setup.py#L8

    Here are the Pipfile and Pipfile.lock:

    [[source]]
    
    url = "https://pypi.python.org/simple"
    verify_ssl = true
    name = "pypi"
    
    
    [packages]
    
    django-phonenumber-field = "*"
    
    
    [dev-packages]
    
    
    {
        "_meta": {
            "hash": {
                "sha256": "1d4c4482eaa30ae2c0c4f7a2391984c1572af4984fa202fd3b5bbfbe37f6f7ac"
            },
            "host-environment-markers": {
                "implementation_name": "cpython",
                "implementation_version": "3.6.4",
                "os_name": "posix",
                "platform_machine": "x86_64",
                "platform_python_implementation": "CPython",
                "platform_release": "15.6.0",
                "platform_system": "Darwin",
                "platform_version": "Darwin Kernel Version 15.6.0: Fri Feb 17 10:21:18 PST 2017; root:xnu-3248.60.11.4.1~1/RELEASE_X86_64",
                "python_full_version": "3.6.4",
                "python_version": "3.6",
                "sys_platform": "darwin"
            },
            "pipfile-spec": 6,
            "requires": {},
            "sources": [
                {
                    "name": "pypi",
                    "url": "https://pypi.python.org/simple",
                    "verify_ssl": true
                }
            ]
        },
        "default": {
            "babel": {
                "hashes": [
                    "sha256:ad209a68d7162c4cff4b29cdebe3dec4cef75492df501b0049a9433c96ce6f80",
                    "sha256:8ce4cb6fdd4393edd323227cba3a077bceb2a6ce5201c902c65e730046f41f14"
                ],
                "version": "==2.5.3"
            },
            "django": {
                "hashes": [
                    "sha256:52475f607c92035d4ac8fee284f56213065a4a6b25ed43f7e39df0e576e69e9f",
                    "sha256:d96b804be412a5125a594023ec524a2010a6ffa4d408e5482ab6ff3cb97ec12f"
                ],
                "version": "==2.0.1"
            },
            "django-phonenumber-field": {
                "hashes": [
                    "sha256:d96c274a6aa9afd4eb4fe922e475a45706d997b2bea22b87f3afc9fb0012db84"
                ],
                "version": "==2.0.0"
            },
            "pytz": {
                "hashes": [
                    "sha256:80af0f3008046b9975242012a985f04c5df1f01eed4ec1633d56cc47a75a6a48",
                    "sha256:feb2365914948b8620347784b6b6da356f31c9d03560259070b2f30cff3d469d",
                    "sha256:59707844a9825589878236ff2f4e0dc9958511b7ffaae94dc615da07d4a68d33",
                    "sha256:d0ef5ef55ed3d37854320d4926b04a4cb42a2e88f71da9ddfdacfde8e364f027",
                    "sha256:c41c62827ce9cafacd6f2f7018e4f83a6f1986e87bfd000b8cfbd4ab5da95f1a",
                    "sha256:8cc90340159b5d7ced6f2ba77694d946fc975b09f1a51d93f3ce3bb399396f94",
                    "sha256:dd2e4ca6ce3785c8dd342d1853dd9052b19290d5bf66060846e5dc6b8d6667f7",
                    "sha256:699d18a2a56f19ee5698ab1123bbcc1d269d061996aeb1eda6d89248d3542b82",
                    "sha256:fae4cffc040921b8a2d60c6cf0b5d662c1190fe54d718271db4eb17d44a185b7"
                ],
                "version": "==2017.3"
            }
        },
        "develop": {}
    }
    
    
    Describe your environment
    1. OS Type: macos
    2. Python version: 3.6.4
    3. Pipenv version: 9.0.1
    Expected result

    I expect that django-phonenumber-field and all its dependencies will be installed.

    Actual result

    phonenumberslite is not installed.

    Steps to replicate
    1. pipenv install django-phonenumber-field
    2. pipenv run pip freeze, you will see something like:
    Babel==2.5.3
    Django==2.0.1
    django-phonenumber-field==2.0.0
    phonenumberslite==8.8.9
    pytz==2017.3
    
    1. pipenv --rm (we simulate a situation when we have to use Pipfile for installing dependencies)
    2. pipenv install
    3. pipenv run pip freeze, you will see something like this:
    Babel==2.5.3
    Django==2.0.1
    django-phonenumber-field==2.0.0
    pytz==2017.3
    
    opened by sobolevn 10
  • Add by region lookup method for phonenumberfields

    Add by region lookup method for phonenumberfields

    Phone numbers can be found using associated region like 'FR', 'UK', 'US', etc.

    queryset.filter(phone_number_field__region='FR)
    queryset.get(phone_numer_field__region='UK')
    

    Using startswith pattern with region codes

    LIKE '+44%';
    
    opened by cmehay 9
  • If blank=True, it's impossible to save an empty phone number

    If blank=True, it's impossible to save an empty phone number

    If you define a field like this in your models.py:

        faxnumber = PhoneNumberField(u'Fax',max_length=40,blank=True)
    
    You'll have this backtrace:
    
    Environment:
    
    
    Request Method: POST
    Request URL: http://morphee.hq.eyepea.be:8001/admin/xivo_web/entity/3/
    
    Django Version: 1.3.1
    Python Version: 2.5.2
    Installed Applications:
    ['django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'django.contrib.admin',
     'xivo_web']
    Installed Middleware:
    ('django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware')
    
    
    Traceback:
    File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
      111.                         response = callback(request, *callback_args, **callback_kwargs)
    File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in wrapper
      307.                 return self.admin_site.admin_view(view)(*args, **kwargs)
    File "/usr/lib/python2.5/site-packages/django/utils/decorators.py" in _wrapped_view
      93.                     response = view_func(request, *args, **kwargs)
    File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
      79.         response = view_func(request, *args, **kwargs)
    File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in inner
      197.             return view(request, *args, **kwargs)
    File "/usr/lib/python2.5/site-packages/django/utils/decorators.py" in _wrapper
      28.             return bound_func(*args, **kwargs)
    File "/usr/lib/python2.5/site-packages/django/utils/decorators.py" in _wrapped_view
      93.                     response = view_func(request, *args, **kwargs)
    File "/usr/lib/python2.5/site-packages/django/utils/decorators.py" in bound_func
      24.                 return func(self, *args2, **kwargs2)
    File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in inner
      217.                 res = func(*args, **kwargs)
    File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in change_view
      982.                 self.save_model(request, new_object, form, change=True)
    File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in save_model
      665.         obj.save()
    File "/usr/lib/python2.5/site-packages/django/db/models/base.py" in save
      460.         self.save_base(using=using, force_insert=force_insert, force_update=force_update)
    File "/usr/lib/python2.5/site-packages/django/db/models/base.py" in save_base
      526.                         rows = manager.using(using).filter(pk=pk_val)._update(values)
    File "/usr/lib/python2.5/site-packages/django/db/models/query.py" in _update
      491.         return query.get_compiler(self.db).execute_sql(None)
    File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py" in execute_sql
      869.         cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
    File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py" in execute_sql
      735.         cursor.execute(sql, params)
    File "/usr/lib/python2.5/site-packages/django/db/backends/util.py" in execute
      34.             return self.cursor.execute(sql, params)
    File "/usr/lib/python2.5/site-packages/django/db/backends/mysql/base.py" in execute
      86.             return self.cursor.execute(query, args)
    File "/var/lib/python-support/python2.5/MySQLdb/cursors.py" in execute
      168.         if not self._defer_warnings: self._warning_check()
    File "/var/lib/python-support/python2.5/MySQLdb/cursors.py" in _warning_check
      82.                     warn(w[-1], self.Warning, 3)
    File "/usr/lib/python2.5/warnings.py" in warn
      62.                   globals)
    File "/usr/lib/python2.5/warnings.py" in warn_explicit
      102.         raise message
    
    Exception Type: Warning at /admin/xivo_web/entity/3/
    Exception Value: Column 'faxnumber' cannot be null
    
    opened by GMLudo 9
  • Converting existing `CharFields` to `PhoneNumberField` with intact lookup

    Converting existing `CharFields` to `PhoneNumberField` with intact lookup

    When converting from:

    class MyModel(Model):
         phone = CharField()
    

    to

    class MyModel(Model):
         phone = PhoneNumberField()
    

    The old data is not lost. However, a lookup like:

    my_result = MyModel.objects.filter(phone=PhoneNumber.from_string('+31629322282'))
    

    does not yield any result; after re-saving all entries by doing:

    for m in MyModel.objects.all():
        m.save()
    

    The lookup does work. My guess is that when migrating from a Charfield to a PhoneNumberField some format conversion is not done. It would make sense that an AlterField operation in the migrations would convert the old values to the new values via PhoneNumber.from_string().

    It is possible for the programmer to do this themselves through a custom migration of course.

    Should this functionality be automatic?

    opened by lmbak 1
  • Formatting being lost

    Formatting being lost

    I recently upgraded to django-phonenumber-field[phonenumbers]==7.0.0 and now all my phone numbers, previously formatted like (800) 123-4567, are being reformatted as +18001234567.

    Do you know why this is?

    Is there a new flag or formatting template I should set to maintain my preferred format?

    opened by chrisspen 5
  • Document E164 lack of support for phone extensions

    Document E164 lack of support for phone extensions

    While changing the default is likely to cause large breakage, we can at least advertise that limitation and allow people to pick the INTERNATIONAL format (E163) if they need to support extensions.

    Fixes #205

    opened by francoisfreitag 0
  • Problem to validate short business numbers

    Problem to validate short business numbers

    Hi,

    I just tried django-phonenumber-field in my project and it seems so good. but I have problem to enter short numbers specially 4 or 5 digit numbers that used to use for business call centers.

    Is there any settings that let me validate such numbers or it need a hack?

    opened by Ali-Javanmardi 4
Releases(7.0.1)
  • 7.0.1(Dec 6, 2022)

    What's Changed

    • Allow multiple DRF is_valid calls to succeed by @phillipuniverse in https://github.com/stefanfoulis/django-phonenumber-field/pull/543

    New Contributors

    • @phillipuniverse made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/543

    Full Changelog: https://github.com/stefanfoulis/django-phonenumber-field/compare/7.0.0...7.0.1

    Source code(tar.gz)
    Source code(zip)
  • 7.0.0(Sep 7, 2022)

    Possible backward incompatibilities

    • RegionalPhoneNumberWidget becomes the default widget for the formfields.PhoneNumberField.
    • The formfields.PhoneNumberField no longer sets the input_type attribute of its widget to tel. That behavior did not make sense for the existing PhoneNumberPrefixWidget and was dropped.
    • PhoneNumberInternationalFallbackWidget will be replaced by RegionalPhoneNumberWidget in the next major version. It is deprecated until the next major release.

    Changes

    • Restore PhoneNumberPrefixWidget number input on form errors by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/520

      Fixes a bug where the form field prepare_value() transformed the PhoneNumber value to an str in the national format, but PhoneNumberPrefixWidget expects its value to be a PhoneNumber. formfields.PhoneNumberField now represents its value with a PhoneNumber object, giving widgets more control on how to display the value.

      That behavior prompted the change to PhoneNumberInternationalFallbackWidget becoming the default widget, to preserve the behavior established in https://github.com/stefanfoulis/django-phonenumber-field/commit/005769cf39323e5b23710783f45befb546672cd6. Switching to the widget allows users to opt-out from that behavior (e.g. by using a TextInput widget), whereas prepare_value() forced the conversion to the national string format.

    • Set PhoneNumberInternationalFallbackWidget input_type to tel by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/521

      Previously, the <input> from the PhoneNumberInternationalFallbackWidget was set to text.

    • Evolve PhoneNumberInternationalWidget to RegionalPhoneNumberWidget by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/529

      The newer widget gives more control over the display of phone numbers. The behavior of PhoneNumberInternaltionalWidget can be retained by setting PHONENUMBER_DEFAULT_FORMAT="INTERNATIONAL", which is why PhoneNumberInternaltionalWidget will be removed in the next major version.

    • Add Dutch translation by @thijskramer in https://github.com/stefanfoulis/django-phonenumber-field/pull/532

    • Add documentation and host it at readthedocs.org by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/531

    • Prefer SUPPORTED_REGIONS over _AVAILABLE_REGION_CODES by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/528

    New Contributors

    • @thijskramer made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/532

    Full Changelog: https://github.com/stefanfoulis/django-phonenumber-field/compare/6.4.0...7.0.0

    Source code(tar.gz)
    Source code(zip)
    django-phonenumber-field-7.0.0.tar.gz(39.79 KB)
    django_phonenumber_field-7.0.0-py3-none-any.whl(64.15 KB)
  • 6.4.0(Aug 28, 2022)

    What's Changed

    • Allow restricting PhoneNumberPrefixWidget country choices by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/525
    • Handle empty input to PhoneNumberPrefixWidget by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/512
    • Handle primitive types in serializerfields by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/523
    • Implement region argument for serializerfields by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/519
    • Fix CHANGELOG link to GitHub Releases by @adamchainz in https://github.com/stefanfoulis/django-phonenumber-field/pull/507
    • Add compatibility with Django 4.1 by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/516
    • Drop support for end-of-life Django 2.2 by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/515

    New Contributors

    • @adamchainz made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/507

    Full Changelog: https://github.com/stefanfoulis/django-phonenumber-field/compare/6.3.0...6.4.0

    Source code(tar.gz)
    Source code(zip)
  • 6.3.0(Jun 17, 2022)

    What's Changed

    • Accept per-widget attrs for PhoneNumberPrefixWidget by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/502
    • Drop Django 3.1 support by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/505

    Full Changelog: https://github.com/stefanfoulis/django-phonenumber-field/compare/6.2.0...6.3.0

    Source code(tar.gz)
    Source code(zip)
  • 6.2.0(Jun 14, 2022)

    What's Changed

    • PhoneNumberPrefixWidget improvement for regions sharing same country prefix by @amateja in https://github.com/stefanfoulis/django-phonenumber-field/pull/493
    • Remove maxlength attribute for html5 compliance by @sterliakov in https://github.com/stefanfoulis/django-phonenumber-field/pull/490
    • Better syntax highlighting by @bashu in https://github.com/stefanfoulis/django-phonenumber-field/pull/498
    • Update Polish translation by @amateja in https://github.com/stefanfoulis/django-phonenumber-field/pull/500
    • Update Lithuanian translations by @KiraLT in https://github.com/stefanfoulis/django-phonenumber-field/pull/390
    • Update Portuguese translations by @AndreMorais98 in https://github.com/stefanfoulis/django-phonenumber-field/pull/504

    New Contributors

    • @bashu made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/498
    • @KiraLT made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/390
    • @sterliakov made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/490
    • @AndreMorais98 made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/504

    Full Changelog: https://github.com/stefanfoulis/django-phonenumber-field/compare/6.1.0...6.2.0

    Source code(tar.gz)
    Source code(zip)
  • 6.1.0(Feb 15, 2022)

    What's Changed

    Features

    • Make formfields.PhoneNumberField honor PHONENUMBER_DEFAULT_REGION by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/476
    • Use the default region’s format in form errors by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/483

    Translations

    • Update and translate uk_AR locale. by @trufanovoleh in https://github.com/stefanfoulis/django-phonenumber-field/pull/360
    • Add persian(farsi) translation by @maktoobgar in https://github.com/stefanfoulis/django-phonenumber-field/pull/479
    • Update turkish translations by @realsuayip in https://github.com/stefanfoulis/django-phonenumber-field/pull/487

    Versioning

    • Add support for Django 4.0 by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/478
    • Drop support for Python 3.6 by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/482

    Miscellaneous

    • Remove unnecessary STR cast from PhoneNumber.__repr__ by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/485
    • Prefer f-string to format strings by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/484
    • Cleanup import in tests by @francoisfreitag in https://github.com/stefanfoulis/django-phonenumber-field/pull/475

    New Contributors

    • @trufanovoleh made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/360
    • @maktoobgar made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/479

    Full Changelog: https://github.com/stefanfoulis/django-phonenumber-field/compare/6.0.0...6.1.0

    Source code(tar.gz)
    Source code(zip)
  • 6.0.0(Nov 10, 2021)

    What's Changed

    • Add support for Python 3.10
    • Update Czech, Dutch and pt_BR translations

    Backwards incompatible changes

    • formfields.PhoneNumberField with a region now display national phone numbers in the national format instead of PHONENUMBER_DEFAULT_FORMAT. International numbers are displayed in the PHONENUMBER_DEFAULT_FORMAT.

    New Contributors

    • @maartenkling made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/449
    • @melanger made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/454
    • @willunicamp made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/456
    • @fraimondo made their first contribution in https://github.com/stefanfoulis/django-phonenumber-field/pull/469

    Full Changelog: https://github.com/stefanfoulis/django-phonenumber-field/compare/5.2.0...6.0.0

    Source code(tar.gz)
    Source code(zip)
Owner
Stefan Foulis
/me ā¤ļø [Python, Django, Docker]
Stefan Foulis
Forward and backwards compatibility layer for Django 1.4, 1.7, 1.8, 1.9, 1.10, and 1.11

django-compat Forward and backwards compatibility layer for Django 1.4 , 1.7 , 1.8, 1.9, 1.10 and 1.11 Consider django-compat as an experiment based o

arteria GmbH 106 Mar 28, 2022
Create a netflix-like service using Django, React.js, & More.

Create a netflix-like service using Django. Learn advanced Django techniques to achieve amazing results like never before.

Coding For Entrepreneurs 67 Dec 08, 2022
Wagtail - Vue - Django : The initial environment of full-stack local dev web app with wagtail and vue

Wagtail - Vue - Django : The initial environment of full-stack local dev web app with wagtail and vue. A demo to show how to use .vue files inside django app.

Quang PHAM 2 Oct 20, 2022
A small Django app to easily broadcast an announcement across a website.

django-site-broadcasts The site broadcast application allows users to define short messages and announcements that should be displayed across a site.

Ben Lopatin 12 Jan 21, 2020
Django Advance DumpData

Django Advance Dumpdata Django Manage Command like dumpdata but with have more feature to Output the contents of the database from given fields of a m

EhsanSafir 7 Jul 25, 2022
A beginner django project and also my first Django project which involves shortening of a longer URL into a short one using a unique id.

Django-URL-Shortener A beginner django project and also my first Django project which involves shortening of a longer URL into a short one using a uni

Rohini Rao 3 Aug 08, 2021
Strawberry-django-plus - Enhanced Strawberry GraphQL integration with Django

strawberry-django-plus Enhanced Strawberry integration with Django. Built on top

BLB Ventures 138 Dec 28, 2022
A pickled object field for Django

django-picklefield About django-picklefield provides an implementation of a pickled object field. Such fields can contain any picklable objects. The i

Gintautas Miliauskas 167 Oct 18, 2022
ProjectManagementWebsite - Project management website for CMSC495 built using the Django stack

ProjectManagementWebsite A minimal project management website for CMSC495 built

Justin 1 May 23, 2022
django-tables2 - An app for creating HTML tables

django-tables2 - An app for creating HTML tables django-tables2 simplifies the task of turning sets of data into HTML tables. It has native support fo

Jan Pieter Waagmeester 1.6k Jan 03, 2023
A real-time photo feed using Django and Pusher

BUILD A PHOTO FEED USING DJANGO Here, we will learn about building a photo feed using Django. This is similar to instagram, but a stripped off version

samuel ogundipe 4 Jan 01, 2020
CRUD with MySQL, Django and Sass.

CRUD with MySQL, Django and Sass. To have the same data in db: insert into crud_employee (first_name, last_name, email, phone, location, university) v

Luis QuiƱones Requelme 1 Nov 19, 2021
Send logs to RabbitMQ from Python/Django.

python-logging-rabbitmq Logging handler to ships logs to RabbitMQ. Compatible with Django. Installation Install using pip. pip install python_logging_

Alberto Menendez Romero 38 Nov 17, 2022
Django Girls Tutorial Workshop

Django Girls Tutorial Workshop A log of activities during the workshop. this is an H2 git remote add origin https://github.com/ahuimanu/django_girls_t

Jeffry Babb 1 Oct 27, 2021
šŸ”„ Campus-Run Django ServeršŸ”„

šŸ« Campus-Run Campus-Run is a 3D racing game set on a college campus. Designed this service to comfort university students who are unable to visit the

Youngkwon Kim 1 Feb 08, 2022
Template de desarrollo Django

Template de desarrollo Django Python Django Docker Postgres Nginx CI/CD Descripción del proyecto : Proyecto template de directrices para la estandariz

Diego Esteban 1 Feb 25, 2022
Source code for Django for Beginners 3.2

The official source code for https://djangoforbeginners.com/. Available as an ebook or in Paperback. If you have the 3.1 version, please refer to this

William Vincent 10 Jan 03, 2023
Visual DSL framework for django

Preface Processes change more often than technic. Domain Rules are situational and may differ from customer to customer. With diverse code and frequen

Dmitry Kuksinsky 165 Jan 08, 2023
PWA is a simple Django app to develope and deploy a Progressive Web Application.

PWA PWA is a simple Django app to develope and deploy a Progressive Web Application. Detailed documentation is in the "docs" directory. Quick start Ad

Nima 6 Dec 09, 2022
Django Fett is an incomplete code generator used on several projects

Django Fett Django Fett is an incomplete code generator used on several projects. This is an attempt to clean it up and make it public for consumption

Jeff Triplett 6 Dec 31, 2021