Documenting Working Codes: Re-Establishing The Fact That We Must Pipenv-Install Django Everytime We Create A New Project Inside The Directory Containing That New Project

in #python4 years ago

First point of call is reminder about what exactly “pipenv shell” is or does

It creates or activates the virtual environment.

Below, the blog directory is a directory with an already pipenv-installed Django and pipenv-shelled environment.

But observe this.

Running the “Django-admin” command on the command line to check if Django is installed in that location returns this:

image.png

Then, we re-open the blog directory and this time first run the “pipenv shell” on it. i.e. activate it.

Then we re-run the “Django-admin” command to check if Django is installed in that location and it returns this:

image.png

Next point of call is to check if we can run “Django-admin” in a new directory by just running “pipenv shell” on it

image.png

Then we run “Django-admin” on it.

Then it returned this:

image.png

Meaning we can’t run “django-admin” in a new directory by just running “pipenv shell” on it.

We must first pipenv-install it.

CONCLUSION: You must activate the virtual environment with “pipenv shell” before you can use that virtual environment.