A Flask backend for the Toga widget toolkit.
Project description
A Flask backend for the Toga widget toolkit.
This package isn’t much use by itself; it needs to be combined with the core Toga library and the Toga Web library.
For more details, see the Toga project on Github.
Prerequisites
This backend requires Flask 1.1 as a minimum requirement.
Usage
Toga Flask defines a TogaApp class that can be used to mount a Toga Web instance in a Flask app. If you have Toga application named myapp, Flask deployment is acheived by putting the following into flaskapp.py:
from flask import Flask flask_app = Flask(__name__) from toga_flask import TogaApp from myapp import app TogaApp(app).route(flask_app, '/')
This will mount the Toga app at /. You can mount the app at any URL you wish, and you can also add other routes for other views.
The app can then be executed with:
$ FLASK_APP=flaskapp.py FLASK_DEBUG=1 flask run
This assumes a standard Toga app layout, where the application myapp has a submodule app.py that defines a main() method.
Community
Toga is part of the BeeWare suite. You can talk to the community through:
The beeware/general channel on Gitter.
Contributing
If you experience problems with this backend, log them on GitHub. If you want to contribute code, please fork the code and submit a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for toga_flask-0.3.0.dev24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a704cfc3ff1bf0c9ad5b5caf86a72ca55c3a4c4e19c3dcad95d13cdac80a4c03 |
|
MD5 | aee3f93eeb8779dc7a80d155ad39a07a |
|
BLAKE2b-256 | fbc712dea33c9ba418090bb8264bdfca89d33f34ec32c0cdd962ef0aee9586f3 |