League
User
Player
Season
Tournament
Score
ScoringSystem
TODO: History
Leaderboard
Setup environment
virtualenv virtualenv
source ./virtualenv/bin/activate
pip install -r requirements.txt
Prerequisites
psql
utility (on CentOS this is in the postgresql
package)Start the docker container using Vagrant
vagrant up
Connect to the container using psql
. Note this uses a dev password. Definitely don't use this in production.
PGPASSWORD=PokerScores123 psql -h localhost -U django pokerscores
NOTE All following steps assume you're in the pokerscores/
directory and have the virtualenv/
activated.
YOU DON"T NEED TO DO THIS STEP. This is how i setup the project initially.
django-admin startproject pokerscores
DATABASE_PASSWORD=PokerScores123 python manage.py startapp api
NOTE Only need to do this on the first run.
DATABASE_PASSWORD=PokerScores123 python manage.py migrate
DATABASE_PASSWORD=PokerScores123 python manage.py runserver
Test out the site by going to http://localhost:8000/api
Edit yoor model code
Creating migrations
DATABASE_PASSWORD=PokerScores123 python manage.py makemigrations api
Run the migrations, note the number will be created above and will be different that 0001
DATABASE_PASSWORD=PokerScores123 python manage.py sqlmigrate api 0001