nmaludy / django-pokerscores

Web App that tracks Poker tournaments, scores and leaderboards
Apache License 2.0
1 stars 1 forks source link

Build Status License

Poker Leaderboard App

Data

League

User

Player

Season

Tournament

Score

ScoringSystem

TODO: History

Leaderboard

Steps

Setup environment

virtualenv virtualenv
source ./virtualenv/bin/activate
pip install -r requirements.txt

Starting Database container

Prerequisites

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

Create the project

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

Initialize the database

NOTE Only need to do this on the first run.

DATABASE_PASSWORD=PokerScores123 python manage.py migrate

Run the test server (dev only)

DATABASE_PASSWORD=PokerScores123 python manage.py runserver

Test out the site by going to http://localhost:8000/api

Editing models

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