[mod_python] ANN: Vampire 1.1 is now available.

Graham Dumpleton grahamd at dscpl.com.au
Sat Oct 9 18:32:01 EDT 2004


Vampire 1.1 is now available from:

   http://www.dscpl.com.au/projects/vampire

To quote some of the description from the web site:

   Vampire can be seen as an extension of the "AddHandler" and 
"SetHandler"
   directives which are normally used to dictate which content handler is
   used to service a request. Rather than such a decision being made by 
Apache,
   it is brought into the scope of Python code executing under 
mod_python.
   Doing this results in a greater ability to control exactly which 
content
   handler is used to generate the content returned in response to a 
request.

   ...

   An important philosophy underlying Vampire, is that URLs should not 
expose
   the means by which a web site is implemented. If a resource is 
presented as
   HTML markup and an extension is going to be used, then the URL for 
that
   resource should use a ".html" extension regardless of what 
implementation
   mechanism is used to generate the page. If the mechanism used to 
generate
   the content is changed, the URL should be able to remain as it was.

   A further philosphy underlying Vampire is that the content handler 
which
   is to be used should primarily be determined based on the name of the 
resource
   being requested and not the extension on the request. As such, 
individual
   resources should each have their own content handler stored in a file 
specific
   to the resource. Only where a resource can be represented in multiple 
formats,
   would the file associated with that resource contain more than one 
content
   handler, one for each data format that the resource is available in.

Note that Vampire is not a framework. That is, it doesn't dictate any 
specific
mechanism for generating page content, its primary intent is to make 
the use
of basic content handlers a bit more flexible.

This does not preclude the use of content generation mechanisms such as 
psp
or mpservlets, both can still be used within the context of Vampire. In 
doing
so, one can break from having to use implementation specific extensions 
such
as ".psp" and ".mps" and instead use extensions more relevant to the 
type of
content returned, eg., ".html". Alternatively, the REST style idea of 
using
no extension at all can also be adopted.

The major features which are implemented by Vampire are as follows:

     * A content handler selection mechanism which allows unique content 
handlers
       to be associated with individual resources. Default content 
handlers may
       also be defined which will be triggered for specific types of 
resources
       when no dedicated content handler exists for a resource.

     * A module importing and caching system which can track parent/child
       relationships between modules and will automatically reimport a 
parent
       module when the child module has changed, thus avoiding the need 
to restart
       Apache.

     * Automatic unmarshalling and passing of form data to a content 
handler
       method when a content handler defines extra arguments in addition 
to
       that of the request object.

     * A user authentication mechanism for individual content handlers,
       implemented in the same style as that provided by the 
mod_python.publisher
       module.

     * An application configuration mechanism incorporating a dynamic 
search
       capability for finding an appropriate configuration file within a 
parent
       directory without the need to hard code relative paths into code.

     * A handler for servicing XML-RPC requests and mapping them into 
code
       associated with your application, thus making it possible to also 
write
       external scripts which can interact with your application and 
turn it
       into a web service.

     * A template loading and caching system for the third party web 
templating
       engine called HTMLTemplate.

The package contains a few examples, including some which demonstrate 
basic
use of the HTMLTemplate, psp and mpservlets systems for generation of 
HTML.
There are also some examples showing use of ReportLab and Tiny RML2PDF 
for
generation of PDF documents on the fly.

At the moment, a good tutorial and more exhaustive documentation is 
lacking, but
the web site describes the basic functionality. Additional 
documentation will
follow as time and demand permits.

If there are any questions, post them here on the mod_python mailing 
list.

Enjoy, even if it is only of academic interest. :-)

--
Graham Dumpleton (grahamd at dscpl.com.au)



More information about the Mod_python mailing list