This project was part of my graduation project at Southwest University, and also part of the COMPSCI 780 project at the University of Auckland. It's a teaching website built on Django, specifically tailored for Introduction to Computer Science course. To get started using the site, you can log in with the username admin
and password password
.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Ensure you have the following installed on your local machine:
- Python 3.6.8 or higher
- Git
First, you'll need to clone the repository. Open your command line or terminal and run:
git clone https://github.com/slin648/TeachingSite.git
cd TeachingSite
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
Then open the browser and go to localhost:8000, and you should see the website running.
This guide is for deploying the project on a CentOS SELinux 8 x64 system.
ssh-keygen -R +[SERVER_IP]
ssh root@[SERVER_IP]
- Python 3.6.8
- SQLite version 3.26.0
pip3 install virtualenv
virtualenv djangoenv
source ~/djangoenv/bin/activate
pip install django==3.1.7
pip install django-widget-tweaks
pip install Pillow
-
Zip the project directory on your local machine
-
Send the
teachingsite.zip
file to/root
-
Unzip the file
unzip -o -d /root/tsite teachingsite.zip
sudo firewall-cmd --zone=public --permanent --add-port=8000/tcp
sudo firewall-cmd --reload
Navigate to the project directory and execute the following:
cd tsite
python manage.py makemigrations
python manage.py migrate
python manage.py runserver 0.0.0.0:80
Note: This allows external access. If you don't specify the IP and port, it will only be accessible locally.
-
Install
screen
sudo yum install epel-release sudo yum install screen
-
Create a screen session
screen -S website
-
You can now run the site and then close the SSH remote connection window. To return, log in again and:
screen -r website
Ctrl a+d
: Detach from current session temporarilyscreen -ls
: List all screen sessionsexit
: Exit screenscreen -wipe website
: Delete session