Besides the split-up of code into functional code (the handler) and markup
code (the template), Draco offers a set of facilities that make the
development of dynamic web sites easier. Some of these features are:
- Session Management
- An advanced builtin transparent session management system allows you track
user sessions and store data for them. Both cookie and url tagging methods
are supported. Web robots are excluded from session management. They are
detected based on an extensive database of user agent fingerprints.
- User Management
- The session management subsystem provides the building blocks for a user
management system. Sessions can be either logged in or logged out and
have an integer "userid" attribute. Logged in sessions can be made
persistent.
- Namespaces
- Draco implements a collection of containers, accessible using the Python
dictionary API, where variables can be stored. These containers are called
namespaces. Each namespace has its own lifetime and binding. Variables can
be transferred easily from one namespace to another. The following are
examples of namespaces in Draco.
- The "session" namespace. Variables in the session namespace are
bound to the current session (if it is available).
- The "user" namespace. This namespace is bound to the current user
(if the session is logged in).
- The "application" namespace. Variables stored here are are bound
to the application and get cleared when the application exits or restarts.
- The "server" namespace. Variables in the server namespace persist
indefinately.
- The "args" namespace. This namespace is intialized with the
GET and PUT arguments of the HTTP request.
- The "config" namespace, containing variables from the
configuration file.
- The "cookie" namespace, containing all cookies that were sent
by the remote client.
- System Events
- It is possible to install hooks for certain system events, like when a new
session is generated or when the web application is starting up.
- Tag Rewriting
- It is possible to add an arbitrary function to a HTML tag in the template
output. The function can modify the tags attributes.
- Task Scheduling
- Often in dynamic web sites there is a need for a certain function to be
executed at fixed times. Draco has an integrated event scheduling service so
there is no need for an external cron.
- Image Size Detection
- Draco uses the tag rewriting subsystem to append missing
width=
and
height=
attributes to <img>
tags. These tags are essential for
a user agent to render a page incrementally. Draco liberates the web site
developer from the tedious job of keeping these parameters up to date.
Images in the popular GIF, PNG and JPEG formats are supported.
- Utilities
- A collection of utility classes and function are provided to the web
developer, including date/time classes, a form handling class and html/url
coding functions.
- Debugging and Profiling
- Debugging and profiling of your code is supported directly by Draco and
makes development more efficient.
- Python standard library
- Last but not least: Because Python is used as the scripting language, its
very extensive standard library is directly available to your applications.