This repository contains WiiGolfQ's backend implementation. It is written in Django and uses Django REST Framework for its REST API. It uses PostgreSQL as its choice of SQL database.
- Matchmaking
- Rating system using OpenSkill
- Leaderboards for player ratings and individual score performances
- REST API
- Install PostgreSQL.
- Create a new database and user.
su - postgres
createuser wgquser
createdb wgqdb
psql
# enter postgres password (`postgres` by default)
alter user wgquser with encrypted password 'InsertPasswordHere';
grant all privileges on database wgqdb to wgquser;
git clone git@github.com:wiigolfq/backend
cd backend
cp .env.example .env
nano .env #change environment variables, see below
DJANGO_SECRETPOSTGRES_DBPOSTGRES_USERPOSTGRES_PASSWORD- Postgres credentials you just made.
POSTGRES_HOST- The database should be at
[POSTGRES_HOST]:5432. Defaults tolocalhostifDEBUGistrue.
- The database should be at
DEBUG- Leave
falsein production.
- Leave
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 manage.py migrate
python3 manage.py createsuperuser
# follow on-screen instructions
python3 manage.py runserver
The backend should now be up at localhost:8000. Visit http://localhost:8000/admin to log into the admin panel with the superuser credentials you created.