This is a project for the Swim4Love event. It is a web application that allows users to track the swimmers.
- Python 3.x
- pip
- Clone the repository:
git clone https://github.com/HenryXiaoYang/Swim4LoveV2.git
cd Swim4LoveV2
- Install Python dependencies:
pip install -r requirements.txt
- Edit the .env file to set your secret key:
DJANGO_SECRET_KEY=your_secret_key
Make sure to keep your keys safe!
-
Edit the Swim4LoveV2/settings.py file if you need to change some Django settings.
-
Collect static files:
python3 manage.py collectstatic
- Migrate the database:
python3 manage.py makemigrations
python3 manage.py migrate
- Create a superuser
python3 manage.py createsuperuser
- Run the server:
gunicorn Swim4LoveV2.wsgi -c gunicorn.conf.py
- Open your browser and go to
http://127.0.0.1:8000/
to view the website. - Use your superuser credentials to log in.
- Build the image:
sudo docker build -t henryxiaoyang/swim4lovev2 .
- Run the image:
sudo docker run -d \
--name swim4lovev2 \
--restart always \
-v swim4lovev2:/app \
-e DJANGO_SECRET_KEY=Your-Secret-Key \
-p 8000:8000 \
henryxiaoyang/swim4lovev2
or use docker-compose:
version: "3"
services:
swim4lovev2:
image: henryxiaoyang/swim4lovev2
container_name: swim4lovev2
restart: always
volumes:
- swim4lovev2:/app
environment:
DJANGO_SECRET_KEY: Your-Secret-Key
ports:
- "8000:8000"
volumes:
swim4lovev2:
docker-compose up -d