[2 min installs] Django on Ubuntu

Better Stack Team
Updated on August 29, 2022

Here is how to install Django framework on Ubuntu 20.04 in under two minutes:

Step 0 - Install python

Before we start it is important to check if python in already installed on your system. To do that, run the following command:

python
Copied!

If python is not installed on your system, install it using the following command:

sudo apt-get update && sudo apt-get install python3.10
Copied!

Step 1 - Install pip

For the remaining steps, you will need pip. Run the following command to upgrade your python version to support pip.

python -m ensurepip --upgrade
Copied!

Then download pip script from the official source.

Now, navigate to the destination, where the script was downloaded and run the following command:

python get-pip.py
Copied!

Step 2 (Optional) - Create virtual environment

In this optional step, you will create a virtual environment. If you choose to skip this step, Django will be installed globally on your system.

Create the virtual environment:

python3 -m venv nameoftheenv
Copied!

Activate the environment:

source nameoftheenv/bin/activate
Copied!

Step 3 - Install Django

Finally, install the Django framework by running the following command:

python -m pip install Django
Copied!

That’s it

You have installed the Django framework and now you are ready to build web applications on python.

Check Uptime, Ping, Ports, SSL and more.
Get Slack, SMS and phone incident alerts.
Easy on-call duty scheduling.
Create free status page on your domain.
Got an article suggestion? Let us know
Next article
[2 min installs] Laravel on Ubuntu
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.