jazzband / django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
MIT License
1.67k stars 446 forks source link

Is `phonenumbers` a required dependency? #581

Open matthewhegarty opened 1 year ago

matthewhegarty commented 1 year ago

I am trying to remove the phonenumbers dependency, but it looks like it is required.

The documentation states:

This project uses django-phonenumber-field which requires either phonenumbers or phonenumberslite to be installed.

However the release notes for 1.14.0 say:

BREAKING: The phone capability moved to a plugins folder, so if you use that capability and want to keep it, you should add two_factor.plugins.phonenumber line in your INSTALLED_APPS setting.

When I have removed the import of phonenumbers from my requirements file, I get:

ModuleNotFoundError: No module named 'phonenumbers'

from the import on this line.

My settings have the following:

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.humanize",
     ...
    "django_otp",
    "django_otp.plugins.otp_static",
    "django_otp.plugins.otp_totp",
    "two_factor",
    ...
]

Steps to Reproduce (for bugs)

Try to build project without the phonenumbers dependency.

Context

Trying to remove the phonenumbers dependency but cannot do so.

Your Environment

claudep commented 1 year ago

Yes, completely isolating phone-related stuff is still WIP (#469). If you have ideas to contribute, feel free to suggest a patch.