Hi all,
Please forgive me if I'm not understanding something. I'm writing this email to seek clarification about how to proceed with the toga-django app[2]. FWIW I'm about to go to a football game so I'm a little rushed. I don't mean to suggest that this requires changes to toga itself, if it seems that way it's only because I don't have a firm grasp of that module yet.
I've begun to move the demo's files into this package, however some parts of it are a little unsatisfying because they're coupled to the demo. For example, the demo's template includes js/python bytecode sources directly[1]. This got me to thinking about what one would want out of such a backend at all. Seems to me that a developer would ideally want to:
1. Define a toga.App without regard to the backend.
2. Import the App for use on the desired platform -- in this case "Django" is the platform.
3. Subsequently specify any platform-specific options through inheritance or some "glue" code. For example with Django, specify the url of the app.
In the demo the Django-specific options that a user might wish to customize (like the template and url) belong to the base class of the App. Is this a deliberate choice? Or should these properties indeed be defined by the user?
Additionally I'm a little unclear as to the best way to *include* the app -- in the demo you create a template and then include the App's container object. Am I correct in thinking this is desirable? That it's good to leave some details of the site's layout up to a template file, so that the user may e.g. modify the appearance of the app's widgets with their own css?
In other words, it suggests the following workflow:
1. Define a class that extends toga.App that defines the layout abstractly, much as you've already done in the demo.
2. Create a view+template and register it to a url the usual way.
3. Provide the rendered App as a context variable so the user can appropriately place it.
Seem good? Or am I missing something?
Best,
Mike