A Django backend for the Toga widget toolkit.
Project description
A Django 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 Django 3.0 as a minimum requirement.
Usage
Toga Django defines a TogaApp class that can be used to mount a Toga Web instance in a Django app. If you have Toga application named myapp, Django deployment is acheived by putting the following into your project’s urls.py:
from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path from toga_django import TogaApp from tutorial import app urlpatterns = [ path('admin/', admin.site.urls), path('/', TogaApp(app).urls), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
This will mount the Toga app at /, the Django admin at /admin, and serve static content in debug mode. 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:
$ ./manage.py runserver
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_django-0.3.0.dev25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e4bcbf3293b197a196b760bd61712340f3281be77a5c0d5ad41bd741ddc6e1 |
|
MD5 | f87ef6713d9a1f7ad9f2065e432fbedb |
|
BLAKE2b-256 | 2ff943989f943cba6e05c258715b99f2f631274b739dbf7f8a5222adfd2833f1 |