Installation Django
To install Django, you must have Python installed, and a package manager like PIP. In other words, using ~=4.0 ensures that you get the latest minor release of Django within the 4.0 series. For example, it could install Django 4.0.1, 4.0.2, 4.1.0, etc., but it won't install Django 5.0 or higher.
Using Poetry (Python dependency management tool)
If you prefer using Poetry for managing dependencies:
-
Install Poetry: Install Poetry by following the instructions at python-poetry.org.
-
Create a new Django project and install Django 4:
-
Activate virtual environment: Poetry automatically creates a virtual environment for each project. To activate it, run:
-
Verify installation: Check Django version: