System (sudo apt-get install)
- mysql-server
- pdftohtml
- memcached
- python-mysqldb
- python
- python-pip
- python libraries: run
pip install -r requirements.txt
For the production server:
- Apache2 supporting mod_wsgi
- Install Dependencies - remember your mysql root password
- Git clone this repository, make sure you are on the master branch
cd utiland rungit clone git@github.com:albertyw/statsonice-keys.git keys- Copy DB_PASSWORD from
util/keys/secret_key.pyintodata/init_database.sqland runmysql -u root --password < data/init_database.sql. Rungit checkout data/init_database.sqlafterwards to remove the changes. - Run
scripts/sync_db.sh --auth - Launch the server by running
scripts/runserver.sh - Check that everything is running by going to localhost:9001
After you have gotten everything installed
- Find issues to work on in github, assign them to yourself.
- Modify code, remember to
git pullandscripts/sync_db.shfrom time to time. git statusandgit commityour modified code.- If your code is ready to be published,
git checkout production,git merge [your current branch],git push,git checkout master. Your new code should be online in a minute.
When you update your database to fix information, you should commit your changes to the repository so that your changes will be reflected on statsonice.com
- Update your database with corrected information. There are many ways to
do this:
- Use a SQL shell (
python manage.py dbshell) - Use a Django shell (
python manage.py shell) - Edit the sql
data/db_dump.sqlfile not recommended - Run the data parsing scripts
- Use a SQL shell (
- Check to make sure your data is correct.
- Run
update_dump.shin thescriptsdirectory. - Commit (
git commit data/db_dump.sql) and push the updated database dump.
There are several scripts in the scripts directory that automate common tasks.
deploy.sh- Runs on the production server to update it when there are new commitsmemcached_status.sh- Continuously shows the current status of memcachedrecalculate_cached_variables.py- Recalculate and save certain variables that were calculated in the databaseremove_temp_files.sh- Remove backup and .pyc files from your reporunserver.sh- Convenience script that automatically restart the django server when it crashessync_db.sh- Update your database with the repository database dumpupdate_dump.sh- Dumps the current database to thedata/db_dump.sqlfileupdate_memcached.py- Updates memcached with data from databaseold/assign_cities_to_coutries.py- Assign city rows in database to countriesold/auth_dump.py- Dump the auth tables from the databaseold/combine_skaters.py- Find and combine duplicate skatersold/remove_skater_name_periods.py- Change skater names to not have periods