I’m currently in the unit 5 of Django and i imported the zip file from the first lesson.
However, after importing i noticed the .vscode file was different from the one I used and had Moch’s file path.
Not only that, but when i try to do input “pipenv install” i get the following error.
PS C:\Users\lewis\Downloads\Django- Resources\Resources\Code\5- Django ORM\Start\storefront> pipenv install
Warning: Python 3.9 was not found on your system…
Neither ‘pyenv’ nor ‘asdf’ could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path\to\python
Any help would be much appreciated!
i just had the same error when starting with the second part, where you have to setup the project again (to have it independent of the first part).
probably you have installed already a newer version than python 3.9.
so go to you pipfile (you should see it on the bottom(?) in the VS Code file explorer.
There, you can change the python version you are currently running.
if you dont know the version, open a command line somehwere and type
I changed the python version in the pipfile to 3.11 and also in the pipfile.lock.
Not sure if it was necessary to change in the pipfile.lock as well.
Thanks for the help blitzoc
i think I figured it! out i had to reset my working directory in vscode everything works now!
Can you help me with this?
I have stuck in this part… After resetting the database i.e. change storefront to the provided storefront folder i faced many issues… i cleared most of them and stuck in this part…
In lesson 41 , he has called objects from the Product class…
but in my case,
i could not find any such thing i.e. objects in Product class…
in the video he would have just imported like,
from store.models import Product but here i couldn’t
i have to call like,
from storefront.store.models import Product
i get error like
ModuleNotFoundError: No module named ‘storefront.store’
It looks like you might be using PyCharm as your editor. When using the free version of PyCharm, I had to import classes in a different manner than I normally would when working on other projects.
The free version of PyCharm also won’t recognize the methods for models when the documentation pops up in the editor, but it will still work when the code runs. As far as I understand, there’s special support for Django if you pay for a license.