You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

In this guide, we will take you through the steps to Install Django on Fedora 31/30/29. Django is a free and open source high-level Python Web framework built by experienced developers to encourage rapid development and pragmatic design. Django takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel.

There are two methods that you can use to install Django on Fedora 31/30/29:

  1. Install Django on Fedora 31/30/29 with pip|pip3
  2. Install Django on Fedora31/30/29 by building from Git

Let’s look at how to use either of the methods to Install Django on Fedora 31/30/29.

Step 1: Install Python3 and Pip3

Your Fedora system should come with Python 3, if it doesn’t have it, install by running the commands below on your terminal.

sudo dnf -y install vim python3 python3-pip

Step 2: Install Django on Fedora 31/30/29 with pip3

The easiest and quickest method of installing Django on Fedora 31/30/29 is with pip3.

Check your Python version

$ python3 -V
Python 3.7.0

Ensure pip3 is installed

$ sudo dnf -y install python3-pip
$ pip3 -V
pip 18.0 from /usr/lib/python3.7/site-packages/pip (python 3.7)

Once installed, Download and install Django on Fedora 31/30/29 with it.

pip3 install --user Django

The installation of Django will give you django-admin command to manage Projects,

$ which django-admin
~/.local/bin/django-admin

Check django-admin version using:

$ django-admin --version
2.1.3

Install Django on Fedora 31/30/29 from Git source code

You can also install Django from source code. Make sure you have Git installed:

sudo dnf -y install git

Check out Django’s main development branch like so:

git clone https://github.com/django/django.git

This will create a directory django in your current directory. Next is to make Django’s code importable and django-admin utility command available:

pip3 install -e django/

Step 3: Create a test Django Application

Create a Django test application by running

mkdir projects
cd projects
django-admin startproject test_app
cd test_app

test_app is the name of our Django Project.

Apply pending migrations

$ python3 manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying sessions.0001_initial... OK

Step 4: Create an Admin Account

Create a Django project superuser account by running the following commands from your Django application directory.

$ python3 manage.py createsuperuser
Username (leave blank to use 'jmutai'): admin
Email address: [email protected]
Password: 
Password (again): 
Superuser created successfully.

Input your admin username, email address, and password.

Step 5: Allow external access to the Django web application (Optional)

Note that by default Django doesn’t allow external access to the application, you need to explicitly define an ACL.

$ vim test_app/settings.py

Edit the lineALLOWED_HOSTS to whitelist your Computer IP or LAN subnet.

ALLOWED_HOSTS = ['192.168.18.23']

You can now  start Django application server:

$ python3 manage.py runserver 0.0.0.0:8090
Performing system checks...

System check identified no issues (0 silenced).
November 10, 2018 - 10:49:58
Django version 2.1.3, using settings 'test_app.settings'
Starting development server at http://0.0.0.0:8090/
Quit the server with CONTROL-C.

If you open the URL http://[server IP/hostname]:8090 you should see a successful message like below:

install django fedora 29 fedora 28

Django Administration page is available on :8090/admin

install django fedora 29 fedora 28 admin page

Login with created username and password:

install django fedora 29 fedora 28 admin page 02

The admin page allows you to add other users, add groups, change password e.t.c. It looks like below:

install django fedora 29 fedora 28 admin page 02 1

Enjoy writing your Web application with Django Framework on Fedora 31/30/29. Don’t forget to check other Fedora articles available on our website.

How to Install Apache Tomcat 9 on CentOS 7 / Fedora

How to install Docker on Fedora

How to install LAMP Stack on Fedora

Install and Configure phpMyAdmin on Fedora

How to install PostgreSQL 11 on Fedora

How to install MySQL 8.0 on Fedora

As an appreciation for the content we put out,
we would be thrilled if you support us!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here