Michigan Flora backend, includes Flora REST API to interact with the MI Flora and Specimen database.
- Full Install/Integration Guide: Describes how to set up and run the full stack locally, as well as deployment to the server.
-
Create a virtual environment for the code.
- On Apache server - If you use Python 3's venv command, it will not install the needed activate_this.py script, so you'll need to provide this. See here for details.
- Any other setup - Follow the standard method.
-
Activate the virtual environment in your terminal.
source /path/to/env/bin/activate
-
Install the required packages via pip3
- Required packages are in requirements.txt. Install using:
pip3 install -r requirements.text
orpython3 -m pip install -r requirements.txt
-
Create an instance folder within the root directory, and place authConfig.py in there. The user database will be created/stored there as well.
-
Put the credential file (something like mif_bet_cred.p) in the application folder. This file can be created with write_credentials in core.py and contains a pickled version of the username and password for non-admin access to the database.
- For authentication, there are two REDIRECT_URI variables defined in authConfig - one for local/development, the other for production/server. Be sure the correct one is set for the environment.
- For authentication in a local environment, there's an additional line in
init.py:
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = "1"
Remove this line when deploying to the server. - Note that once the code has been deployed to the server (currently miflora-beta.lsait.lsa.umich.edu),
you must touch the app.wsgi file in order to trigger Apache server to restart the app.
This can be done with the command
touch app.wsgi
.