Flask WSGI tool example
Clone or download
Latest commit a8dfa15 Dec 21, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
templates Use OAuth for authentication Dec 21, 2018
.gitignore Use OAuth for authentication Dec 21, 2018
LICENSE Initial commit Dec 21, 2018
README.md Update README.md Dec 21, 2018
app.py Use OAuth for authentication Dec 21, 2018
requirements.txt Use OAuth for authentication Dec 21, 2018

README.md

flask-oauth

Flask WSGI tool example with OAuth: https://wikitech.wikimedia.org/wiki/Help:Toolforge/My_first_Flask_OAuth_tool

Requires an OAuth consumer grant from https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose and a config.yaml file with the contents:

GREETING: Goodnight moon!
SECRET_KEY: <random secret string>
OAUTH_MWURI: https://meta.wikimedia.org/w/index.php
CONSUMER_KEY: <consumer token>
CONSUMER_SECRET: <consumer secret token>

For SECRET_KEY, try using the results of python -c "import os; print(repr(os.urandom(24)))".

Install dependencies with pip install -r requirements.txt (preferably in a virtualenv).

To run locally, try FLASK_APP=app.py FLASK_ENV=development flask run.