The Flask-based, PostgreSQL backed REST API to capture observations on the migration patterns of endangered species
TODO
Create the birdseye database, user and set it up with the GIS extension.
.. code:: bash
sudo apt-get install postgresql-9.6 sudo apt-get install postgresql-9.6-postgis-2.3 postgresql-contrib-9.6 libpq-dev postgis
sudo -i -u postgres
createuser -P birdseye (password birdseye)
createdb -E UTF8 -O birdseye birdseye createlang plpgsql birdseye psql -d birdseye -c "CREATE EXTENSION postgis;" psql -d birdseye -c "CREATE EXTENSION postgis_topology;" psql birdseye grant all on database birdseye to "birdseye"; grant all on spatial_ref_sys to "birdseye"; grant all on geometry_columns to "birdseye"; \q
Requires python 3.5 (and above) and python-pew to manage the python virtualenv.
.. code:: bash
pew new birdseye pip install -r dev-requirements.txt
Assuming homebrew is used, assuming pip, pew and pythonz are installed.
Install python and friends:
.. code:: bash
xcode-select --install brew install openssl export CPPFLAGS="-I/usr/local/opt/openssl/include" export LDFLAGS="-L/usr/local/opt/openssl/lib" pythonz install 3.5.3
Download and install the Postgres app from http://postgresapp.com/ and start a postgres server 9.6.
Setup a database:
.. code:: bash
brew install postgis createuser -P birdseye # (password birdseye) createdb -E UTF8 -O $USER birdseye createlang plpgsql birdseye psql -d birdseye << EOT CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; grant all on database birdseye to "birdseye"; grant all on spatial_ref_sys to "birdseye"; grant all on geometry_columns to "birdseye"; EOT
Virtual env setup:
.. code:: bash
pew new --python=$(pythonz locate 3.5.3) birdseye pip install -r dev-requirements.txt
.. code:: bash
birdseye --help birdseye reset_tables birdseye test birdseye runserver
Note that supporting services also need rq workers launched:
.. code:: bash
birdseye rq worker # image labeling birdseye nginx_upload_chmod_hack # nginx uploads fiddling with chmod (asks for sudo)
In production gunicorn with gevent is used, will bind to a unix socket created in the same dir from where the server is lauched.
.. code:: bash
birdseye runproduction
- 0.0.1 - Initial release