Django project for population.io
- Python 2.7
- pip 1.5+
- NumPy 1.7.0+, SciPy 0.11.0+, Pandas 0.13.1+ (see http://www.scipy.org/install.html for installation instructions)
- PyTables 3.1+
- further dependencies can be installed with pip from a requirements file
# Create a virtualenv to isolate our package dependencies locally
virtualenv env
source env/bin/activate # On Windows use `env\Scripts\activate`
# Install dependencies
pip install --requirement requirements.txt
# Run development server
python manage.py runserver
You will also have to unpack the CSV data files in the data
subdirectory.
Run all unit tests with python manage.py test
.
Many API requests require an extrapolation table (based on sex and country) to do their work. Generating this table can take a while (up to 20s on an average machine). Therefore, if you have about 25 GiB to spare, you might want to generate all of these ahead of time making the API calls really snappy (far below 1s).
Run python manage.py buildtables
to rebuild all tables. Expect this to take about 2-4 hours.
To just update the CSVs in the data store without rebuilding the tables, run python manage.py reloadcsv
.
- Install Vagrant: https://www.vagrantup.com/.
- Run
vagrant up
in the/vagrant
subdirectory of the project. - View the API docs of your app at
http://localhost:9999/
.