'Unresolved References' in brand new project set up with PyCharm

I have set up a brand new Django project in PyCharm 2020.1 Pro and am getting 'unresolved references' for the Django standard imports eg. 'from django.db import models'.

New virtual environment set up with python 3.7.7. The environment downloads the latest version on Django, 3.0.5. the env folder is a subfolder of the main project, and is marked by a red 'exclude' in the project structure.

Due to the unresolved references I can therefore not perform the autocomplete / method lookup.

 

 

1
2 comments

Hi, please check if you have django-stubs package installed. If not, I think it is better to submit an issue at https://youtrack.jetbrains.com/issues for closer investigation (be sure to provide code/project sample and steps to reproduce).

1

Andrey Resler thank you for your reply. In the end a complete re-install of pyCharm did not help. I don't know where to look to see if django-stubs is installed. If it is supposed to be part of the virtualenv it is not there.

However, I did resolve the issue by using Configure:Restore Default Settings from the Project Select startup window. Now the standard python projects (with django installed) and a standard pyCharm django project resolves the references and the autocomplete works.

This may have been in issue going from pyCharm Community to Pro, but I have found a solution none the less.

0

Please sign in to leave a comment.