This project contains a website created with Django 3.1.1, Python 3.7, HTML 5 and CSS combined with the library Bootstrap 4. It is managed by gunicorn.
Using the package manager pip:
Upgrade pip and install all the requirements:
pip3 install --upgrade pip
pip3 install --no-cache-dir -r requirements.txt
The project uses the database PostgreSQL which has to be downloaded here in order to create a database for the website (I would recommand to download the Postgres App).
- Connect to the machine in a Terminal
ssh -i "goodness-groceries.pem" [email protected]
- Pull changes from the github repository
cd ~/git/BSP3
git pull
- Migrations commands
python3 manage.py makemigrations
python3 manage.py migrate
- Restart unicorn
sudo systemctl restart gunicorn
Execute this command to check the webserver status
sudo systemctl status gunicorn
To run the website on your local machine:
- Open the Postgres App and create a server and a database
- Open the project and go to the directory "GoodnessGroceries_Project" in the main folder
- Open the python file "settings.py" and scroll down to "DATABASES", there you have to change the settings such that it corresponds to your created database
- Open the terminal and go to the folder where the project is located (the "manage.py" file should be located in this folder)
- Being in this folder in the terminal, run the command
python3 manage.py runserver
(The database server has to be running) - The server is now running on your local host, to access the website go to some browser (Chrome was used for developping) and go to http://localhost:8000/, this will redirect you to your local host with the port 8000 where the website is running