I am having an issue with the django
and rest_framework
packages not successfully being imported into PyCharm Professional.
In the project preferences, I have the Django support enabled and the project root, settings file, and manage file properly set. I have the project interpreter using a Virtualenv environment that Pycharm created when I created the project. The project interpreter has all of the packages defined in the requirements.txt.
installed.
In most Python files in my project, I am noticing that some of the rest_framework
packages can be imported, but others cannot be for no apparent reason. For example, the import from rest_framework.views import APIView
is able to import properly, but from django.http import HttpResponse
does not import properly and shows Unresolved reference 'HttpResponse'
.
I notice that the reference to django.http
can be resolved, so I am not sure why the reference to HttpResponse
cannot be found.
I have tried the following to fix the issue:
.idea
file and re-import the project.I am really lost as to what to try next. The main benefit to using PyCharm is the IntelliSense features and these do not work properly with all packages not being imported properly. Any recommendations are greatly appreciated :)