0

I'm having problems with importing stuff from Django. I'm entirely new to python and I'm following a tutorial where I'm taught how to make my first Django project (I'm using Pycharm by the way). The problem I'm encountering is when I try to import something from Django it says Unresolved reference 'django'.

from django.http import HttpResponse
from django.shortcuts import render

This case only shows the red squiggly line under the two HttpResponse, and render.

Any help would be appreciated, I have tried searching on google, but I couldn't find what I'm looking for.

Javad
  • 2,033
  • 3
  • 13
  • 23
  • Did you install django? It's not built in. `pip install django`. – Tim Roberts Dec 19 '22 at 20:04
  • Does this answer your question? [Unresolved reference: 'django' error in PyCharm](https://stackoverflow.com/questions/42145656/unresolved-reference-django-error-in-pycharm) – Muhammadyusuf Dec 19 '22 at 20:05
  • Thanks I think this is my problem, but there isn't very specific information about how you then add the package, can you help me with that? – Mikkel hein Wadsholt Dec 19 '22 at 20:57
  • I gave you the command. Once you install it, it is available. – Tim Roberts Dec 19 '22 at 21:09
  • oh well then that's not my problem because I already did that and it just says "Requirement already satisfied" – Mikkel hein Wadsholt Dec 19 '22 at 21:11
  • Have you marked root folder of project as 'Sources root' (as it is said in upper question)? You need to go to settings/Project/Project Structure. Then mark a folder with your app code as 'sources' (blue color). – Julik Dec 22 '22 at 11:31

0 Answers0