Make sure you have Python and pip installed. If not, install them using the following commands:
sudo yum install python3 python3-pip git
Create a virtual environment to isolate your Django project dependencies:
cd ~
python3 -m venv .basic_poll_venv
Activate the virtual environment
source ~/.basic_poll_venv/bin/activate
Update pip in the virtual environment
python3 -m pip install --upgrade pip
Exit a virtual environment
deactivate
Before you can start using Git, you’ll need to configure it with your name and email address. Run the following commands, replacing Your Name with your actual name and you@example.com with your email address:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git clone https://github.com/pgustafs/basic-poll.git
Make sure that your python virtual environment is active, install Django using pip:
python3 -m pip install Django
or
python3 -m pip install -r basic-poll/requirements.txt
Verify that Django is installed correctly and check its version:
django-admin --version
Let’s verify your Django project works. Change into the basic-poll directory, if you haven’t already, and run the following commands:
cd basic-poll
python3 manage.py runserver 0.0.0.0:8000
or using gunicorn
gunicorn base.wsgi:application --bind 0.0.0.0:8000