Example applicationΒΆ

Minimal Flask application example for development.

Run example development server:

$ pip install -e .[all]
$ cd examples
$ export FLASK_APP=app.py
$ flask db init
$ flask db create
$ flask fixtures users
$ flask run

Open the admin page to generate a token:

$ open http://0.0.0.0:5000/account/settings/applications

Make a login with:

username: admin@inveniosoftware.org password: 123456

Click on “New token” and compile the form: insert the name “foobar”, check scope “test:scope” and click “create”. The server will show you the generated Access Token.

Make a request to test the token:

export TOKEN=<generated Access Token>
curl -i -X GET -H "Content-Type:application/json" http://0.0.0.0:5000/ \
    -H "Authorization:Bearer $TOKEN"

Or, if you are logged in through the browser, try to open the homepage with it:

$ open http://0.0.0.0:5000/