Applets

Applets follow roughly the principles of Django applications. They are python modules with:
  • models
  • views
  • templates
  • urls
  • fixtures
  • etc.

Actually Hanji applets are really Django applications, Hanji inserts them automatically in the application list. For example, running syncdb inserts the models in the database, the urls.py files are processed though the Django url dispatch engine, and the templates are written in Django Template Language.

Additionally, applets must define:
  • one instance of the hanji.core.applet.Applet class named applet
  • one instance of the hanji.core.applet.WebUI class named web

Directory structure

It looks like this:

+ hanji
  + applets
    + hello_world
      - __init__.py
      - webUI.py
      + templates
        - content.html
      + static
        - icon.png
        - help.html

Applet class

WebUI class

Table Of Contents

Previous topic

Running the server

Next topic

Using Twisted resources in applets

This Page