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
upliftand a user calledlocal. You will then use these when defining your environment variables.
virtualenv venv
source venv/bin/activate
pip install -r requirements.txtIt'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_METo use autoenv with this repository, run the following and set the variables appropriately.
cp env.template .envCheck the #uplift-backend channel for the service-account-key.json which should be placed in the root directory.
To run the app:
flask runTo run the test suite:
python -m unittest src.tests.test_scraperFlake 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"