Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

725
Views
Unresolved reference: 'django' error in PyCharm

I'm trying to import:

from django.db import models

PyCharm underlines django.db and complains: Unresolved reference 'django'.

How do I get PyCharm to recognize Django?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

I assume you're using a virtualenv which is located in the same directory as other project files. Python should know exactly that path. So, it's possibly that Pycharm is using the wrong Interpreter.

Go to Settings -> Project: -> Project Interpreter -> switch to the right path

In the interpreter packages, there should be Django package installed. If not, do it here/in terminal.

over 4 years ago · Santiago Trujillo Report

0

Mark root folder of project as 'Sources root', it works for me. Content Root

over 4 years ago · Santiago Trujillo Report

0

Above answers are answered partially.

Problem Description: I've multiple versions of python installed and Django is installed in one of Python version. There are two issues

  • Issue 1: Pycharm has wrong python interpreter. For this the Project Interpreter has to be changed to Python version where Django is installed. Solution: Follow all steps.

  • Issue 2: Django isn't listed as package. For this we need make available the installed python packages in the Pycharm environment. Solution: Follow all steps except step 3.

Solution: Peform following steps.

  1. In preference/settings go to Project > Project Interpreter
  2. On right hand side click on settings icon > Add Local
  3. Select correct Python version from Base Interpreter
  4. Mark the checkbox against Inherit global site-packages and Make available to all projects
  5. Click ok

Once this is done in Project Intepreter you will be able to see Django in the Package list.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!