A web site to track X-Wing Miniature Combat lists.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
challonge sweeping the road to prepare for season 1 Apr 17, 2016
dbs hourly backup Jan 19, 2017
static fixing duplicate archtypes Dec 31, 2016
templates minor cleanup Jan 10, 2017
.gitignore Ignore compiled Python, VIM swapfiles. Apr 1, 2015
API_README Create API_README Nov 21, 2015
README.md made venue named required and autocompleted Aug 1, 2016
Taxonomy.monopic sanity checking Jul 3, 2015
api.py added final_salvo Dec 13, 2016
api_tests.py fixed sos REST import error found by dennis Dec 6, 2016
challonge_helper.py sweeping the road to prepare for season 1 Apr 17, 2016
cryodex.py accidentally left out jumpmaster from last ship add; fixed sos Jul 24, 2016
database_tests.py archtypes commit Sep 19, 2015
dataeditor.py fixed sos bug , doh Dec 13, 2016
db_port.py canonized upgrades Jan 1, 2015
decl_enum.py migrated ships over to xws format. Jan 1, 2015
decoder.py heatmap 1.0 Mar 11, 2016
dorsalturret.sql ye old dorsal turret. Jan 31, 2016
go_gen.py palpatine May 28, 2015
myapp.py added time series graphs v1 Feb 8, 2016
persistence.py fixing duplicate archtypes Dec 31, 2016
persistence_tests.py added test for archtype key generation Dec 19, 2016
requirements.txt added final_salvo Dec 13, 2016
rollup.py added venue_id filter to timer series view Aug 6, 2016
search.py forking pychallonge; some sql file cleanup Apr 6, 2016
season_zero_manual_entry.py forking pychallonge; some sql file cleanup Apr 6, 2016
snvdraft_match_gen.py draft match gen script; smuggling compartment addition Aug 25, 2016
tome.py basic impl of FFG TOME Dec 28, 2015
uidgen.py fixing duplicate archtypes Dec 31, 2016
xwingmetadata.py minor cleanup Jan 10, 2017
xwlists.py minor cleanup Jan 10, 2017
xws.py bug fix Jan 17, 2017
xwvassal_league_bootstrap.py fixed weird bug with group_ids changing Sep 29, 2016



Using a Virtualenv is recommended.

This assumes MySQL as a backend, so you'll need mysql_config installed. Consult your OS documentation for how to do that. If you're using a different SQL backend, modify requirements.txt to use the appropriate Python bindings.

virtualenv ~/venv/xwlists
. ~/venv/xwlists/bin/activate
pip install -r requirements.txt

Initializing and Browsing the Database

To familiarize yourself with the database model, please have a look at dbs/database_model.png 

To create the database, from shell run
    mysql < dbs/prod.sql

The file dbs/prod.sql is updated hourly into github from the pythonanywhere server.

This program uses SQL-Alchemy object bindings and expression building for all its sql management. The schema itself is managed manually (it should be using Flask-Migrate).

Running the App

In development mode, so you can see meaningful error messages:

python xwlists.py dev

Here are the two environment variables the program expects and some sample values:

DYLD_LIBRARY_PATH /usr/local/mysql/lib
LOCAL_DB_URL mysql://root...

The url string for your MySQL database will looking something like mysql://$USER_NAME:$PASSPORT@localhost/sozin$lists

Here are the optional environment variables.

DO_MAIL set to 1 if you want email
MAIL_USERNAME if doing mail, your google mail username
MAIL_PASSWORD and your google mail password
ADMIN_EMAIL an email address where you'd like to receive your emails
CHALLONGE_API_KEY if you are using the challonge import functions for vassal league, contact me

Note, if you get the following error on application startup:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_mysql.so Reason: image not found

You'll need to set this env variable: