How to install Django on Debian 9 using venv

Check python version

python3 -V


Python 3.5.3


venv is a tool used to create an isolated workspace for a Python application.
Install venv by running:

sudo apt install python3-venv

Create a Project Directory.

mkdir my_projects


change directory

cd my_projects

create a new virtual environment:

python3 -m venv venv

Activate the virtual environment.

source venv/bin/activate

install the Django package using pip.

pip install Django

run the following command to create a new project

django-admin startproject django_project


To change to your directory, type cd and press

cd django_project

To apply migration, we need to run migrate command as follows

python migrate


Creating an admin user

python createsuperuser


Use the following command to start the server:

python runserver


visit with your Web browser.
The install worked successfully! Congratulations!


open the admin panel

Thank You