Install Django Development Environment on CentOS/RedHat/Fedora

Exported on 28-Aug-2021 14:55:24

Installs Django Development Environment in CentOS/RedHat/Fedora based systems.

Parameters

Name Type Script Reference Default Value Comment
s1 Linux / Unix Server s1
s1c Linux OS Credential s1c

1 - Update Yum repositories

Update yum repositories

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install yum
sudo yum -y update

2 - Install Python version 3 and Pip3

Installs Python3 and Pip3

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install python3
sudo yum install -y python3 python3-pip

3 - Setup VirtualEnv

Installs and configures virtualenv

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install virtualenv
sudo pip3 install virtualenv

4 - Create Virtual Environment

Creates a virtual environment for the Django application.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Create django applications
mkdir django-apps
cd django-apps
virtualenv env

5 - Install Django Package

Install Django pip package

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install Django
sudo pip3 install django

6 - Install SQLite3

Install SQLite database version 3

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Download SQLite latest version
curl https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz -o sqlite-autoconf-3280000.tar.gz


# Unzip SQLite
tar -xzf sqlite-autoconf-3280000.tar.gz

# Install GCC
sudo yum -y install gcc

# Change directory to sqlite
cd sqlite-autoconf-3280000


# Install sqlite
./configure
make
sudo make install

7 - Start Django Development Server

Creates Django project and starts up a Django development server

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
#Update Python's SQLite version
echo 'export LD_LIBRARY_PATH="/usr/local/lib"' >> ~/.bashrc
source  ~/.bashrc

# Create Django project
django-admin startproject mysite

# Start development server
cd mysite
python3 manage.py migrate
python3 manage.py runserver