PlateMate: crowdsourcing nutritional analyses from food photographs
sudo apt-get install libjpeg-dev
pip install -r requirements.txt
This should install:
- Django 1.8.16
- Pillow (latest)
- Boto3 (latest)
- httpagentparser (latest)
- oauth latest
- For a development environment, copy .env.example to .env and set any relevant variables.
- For a production environment, do the same, or set the environment variables in .bashrc or some other method.
If Postgres is installed with brew
- brew info postgresql@9.5
pg_ctl -D /usr/local/var/postgresql@9.5 start
Check if DB is accessible with psql
:
psql platemate platemate
From the platemate directory, run:
python manage.py migrate auth
python manage.py migrate
python manage.py createsuperuser
# TODO add the user to initial data fixutre (or is there one?)
python manage.py changepassword <username>
python manage.py runserver 0.0.0.0:8000
or
./run.sh
python experiment.py BATCH_NAME sandbox
where BATCH_NAME
is a subdirectory under static/uploaded
. This is
hardcoded and specifying any other path will break things.
Cause: Likely an import statement in the module is failing because of a missing library.
Fix: Try each import in the module individually.
It seems that when both the runserver and the experiment scripts are running, there is a race condition on the database that would crash one script if the other is accessing the DB.
http://adminer.iis-dev.seas.harvard.edu/adminer/
python cleanup.py flush