A
A
Art00052020-10-15 17:47:55
PyCharm
Art0005, 2020-10-15 17:47:55

Why does paycharm highlight the import code?

from django.shortcuts import render
from django.template import loader
from django.http import HttpResponse
from django.views import View

under each 'django' label and the fact that I import the red underline, because of this, all the code is red and there are no hints, while no one noticed this. But everything starts

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2020-10-15
@shabelski89

You probably just don't have django installed .
By hovering over the underlined module, you can click Install package
5f8870880a4d1319247646.png

D
dooMoob, 2020-10-15
@dooMoob

You need to set up the project interpreter

F
First Name Last Name, 2020-10-15
@alikk_python

This is all due to the fact that you have not added Django to the interpreter settings, to add it you need to go: File -> Settings -> Interpreter settings. And there choose the version of Python in which Django is installed, or add Django itself there.
PS: Python 3 is usually installed there, you need to choose 3.8 (depending on which version is installed)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question