Menu
User

DropVPS Team

Writer: Cooper Reagan

How to install Django on CentOS 8

How to install Django on CentOS 8

Publication Date

07/19/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Django is a powerful Python web framework used to build secure and scalable web applications. If you’re running CentOS 8, setting up Django is quick and straightforward through the terminal. Let’s dive right into installing Django on CentOS 8 using pip.

Step 1 – Install Python 3 and pip

CentOS 8 comes with Python 3, but it’s good practice to make sure it’s installed and updated:

sudo dnf install python3 -y

Check the versions:

python3 --version
pip3 --version

Step 2 – Install Django with pip

Once Python and pip are ready, install Django globally:

pip3 install django

You can also verify the installation with:

django-admin --version

Step 3 – (Optional) Use a Virtual Environment

If you prefer to isolate your Django projects (recommended for production and testing), create a virtual environment:

python3 -m venv myenv
source myenv/bin/activate
pip install django

To deactivate the environment:

deactivate

Step 4 – Create Your First Django Project

Now that Django is installed, create a new project:

django-admin startproject mysite
cd mysite
python3 manage.py runserver

Access your Django project in a browser at:

http://127.0.0.1:8000/

Django is now up and running on your CentOS 8 system. From here, you can start building apps, connecting databases, and scaling your web project.

Linux VPS
U
Loading...

Related Posts

How to install Django on CentOS 8