pythondjangoimport

Import "phonenumber_field.modelfields" could not be resolved


I have django project and I try to add phonenumber package, I've done 'pip install django-phonenumber-field[phonenumbers]' and I imported the library to my .models but it shows up as an error but it works anyways, the error is called: "Import "phonenumber_field.modelfields" could not be resolved(reportMissingImports)" how do I fix the problem so it won't tell me its a problem and will work like everything else?

Please help :3 my code and error


Solution

  • Try adding it to settings as well. Here’s the example from the docs:

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