I'm new in Python/Django and I'm trying to create a live app. I did create the django project first, then realized I should do this in a venv. So I created the venv within my project folder. I managed to get my PostgreSQL db connected, and since I'm trying to keep my stuff secure, I'm storing my DB password in a global variable.
import environ
from pathlib import Path
env = environ.Env()
environ.Env.read_env()
My problem is that I keep getting the error:
import environ could not be resolved pylance
in my settings.py
file and I've no idea why. I think I've set up my venv correctly and placed it in my project folder.
Is something wrong with my interpreter? I'd really like some help with this please.
This is the error I'm seeing:
I seem to be inside my venv:
I'm able to run my app just fine and update my database no problems. which I'm thinking shouldn't work if there really is an issue with how my venv is setup?
I've tried everything I can think of. Made another venv and played around with it. Only thing I'm stuck on is making sure my interpreter is correct. how can I be sure I'm using the right interpreter? When I try to manually select an interpreter, I don't see any that imply it's in my venv:
Solved. I was just using the wrong path when selecting my interpreter manually.
I right clicked on the appropriate Python3.10 interpreter file and copied the Path url. then pasted it right into the command palette to manually set the interpreter. that refreshed vscode and removed the warning.