Django makes it easier to build better web apps more quickly and with less code.
The official Django website provides great resources for beginners to get up and running. But the package installer and virtual environment might confuse you.
Install database (PostgreSQL)
pipis the package installer for Python. You can use
pipto install packages from the Python Package Index (PyPI) and other indexes.
pipis automatically installed with Python downloaded from Python.org.
venvmodule provides support for creating lightweight “virtual environments” with their own site directories. Each virtual environment has its own Python binary and can have its own independent set of installed Python packages in its site directories. Also known as
virtualenvin Python 2.
venvis automatically installed with Python downloaded from Python.org.
Create virtual environment
The following command will create a new virtual environment in the current directory. This virtual environment and all its related files and data will be stored in the
.venvfolder. You can create and name the
venvwhatever you like but
.venvis fairly standard.
What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?
There are many different packages and virtual environment managers available. Each created to solve a unique issue or to solve it better/faster/more efficient than the other. For now you can safely ignore all of them and just use the standard shipped
Use a separate virtual environment for each project.
Activate virtual environment
To start using your newly created virtual environment you just have to run
If you have multiple environments you can run a specific environment by navigating to its
Once activate, your command shell will be updated and include the name of your
Once your virtual environment is activated, you can use the command shell like you usually would. In this case we will install Django.
Git clone repository
At this point it is recommended to initiate and create your first
git commit. This way you have a nice clean starting point in case anything goes wrong. For more info about
gitsee the git notes.
Deactivate virtual environment when done
- Official Django website
- venv offical docs
- pypi.org Package Index
Created: October 5, 2022