An API for searching, using, and maintaining Data Sources.
Live app: https://data-sources.pdap.io/ deployed from main
Dev app:https://data-sources.pdap.dev/ deployed from dev
API docs / base URL: https://data-sources.pdap.io/api (or ...dev/api)
git clone https://github.com/Police-Data-Accessibility-Project/data-sources-app.git
cd data-sources-app
If you don't already have virtualenv, install the package:
pip install virtualenv
Then run the following command to create a virtual environment:
virtualenv -p python3.11 venv
source venv/bin/activate
pip install -r requirements.txt
pip install "psycopg[binary,pool]"
pre-commit install
# To optionally run the pre-commit against all files (as pre-commit usually only runs on changed files)
pre-commit run --all-files
For more information on setting up environment secrets, see ENV.md
Follow instructions in the /local_database
directory to set up a local database for testing.
python3 app.py
# Within a container -- ensure docker ports are properly bound as well
gunicorn --bind 0.0.0.0:8080 --access-logfile - --access-logformat '%(h)s %({http_x_user_id}e)s %(m)s %(U)s %(q)s %(s)s' --error-logfile - 'app:create_app()'
If you need to run the client web application, refer to the pdap.io documentation.
Generally, local development on the client is done based on the stable deployed dev
API, and API development can usually be verified using curl
. But if you are working on a full stack project for which you need to run the client locally against the API locally, reach out to @maxachis and @joshuagraber in Discord for help.
If you're here to submit a Pull Request, please review the important information available in CONTRIBUTING.md.