Technologies involved include:
- Flask
- GraphQL (Graphene)
- Install PostgreSQL on your local computer.
- Create a database and user:
createdb uplift
createuser -P -s -e local
- This creates a database called
uplift
and a user calledlocal
. You will then use these when defining your environment variables.
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
It's recommended to use autoenv
.
The required environment variables for this API are the following:
export FLASK_ENV=development
export DB_USERNAME=CHANGE_ME
export DB_PASSWORD=CHANGE_ME
export DB_HOST=localhost
export DB_NAME=upliftdb
export APP_SETTINGS=src.config.DevelopmentConfig
export CLIENT_ID=CHANGE_ME
To use autoenv
with this repository, run the following and set the variables appropriately.
cp env.template .env
Check the #uplift-backend
channel for the service-account-key.json
which should be placed in the root directory.
To run the app:
flask run
To run the test suite:
python -m unittest src.tests.test_scraper
Flake 8: Install flake8
Black: Either use command line tool or use editor extension.
If using VS Code, install the 'Python' extension and include following snippet inside settings.json
:
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black"