How to install Django on Debian 9 using virtualenv

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

sudo apt install python python3 virtualenv

Create a Project Directory.

mkdir all_projects


change directory

cd all_projects

create a new virtual environment:

virtualenv -p python3 env

Activate the virtual environment.

source env/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