Setting up the Environment
Before we start, the first thing you need to do is, of course, install Django! You might do this either using a virtual environment or your global Python installation. We recommend to use a virtual environment.
Creating a Virtual Environment For Your Django Projects
If virtual environments seem too complicated for you, just ignore this section and use your global Python installation.
To create a virtual environment, open the terminal and execute:
- Windows
- macOS/Linux
py -m venv env
python -m venv env
After the environment has been created, you need to activate it:
- Windows
- macOS/Linux
env\Scripts\activate
. env/bin/activate
All done! Make sure to use the terminal with the activated environment while following this tutorial.
Installing Django
Since Django is a third-party Python package, you need to install it using pip
. Whether you are using a virtual environment or not, open your terminal and write:
pip install Django
This will install Django and all its dependencies.