"So simple and elegant, yet extremely powerful."
— PSE User
PSE has a powerful templating component based on HTML/xHTML. Templates are automatically compiled into stand-alone servlets, so templates are only ever parsed once, increasing response time to application users. Templates can be a complete servlet in themselves, because they allow Python to be embedded directly in the HTML without any special syntax. Or, they can be used in conjunction with an associated Python module.
PSE allows developers to create pure Python code in a module that executes in the same namespace as the template servlet, allowing the template designer to use any data that has been created in that module. With this model, you can truly separate the work of the HTML Interface Designer and that of the Python Programmer, yet combining both to create a powerful resulting application.
PSE comes with some standard plugins that allow you to get the information you need to write effective web applications. You can get information about the server and client, manipulate cookies, maintain session information, and cache servlet output, to name a few. You can even write your own plugins to provide anything you need that doesn't come with PSE! (See "Creating Plugins" below)
While PSE can use pure HTML to create templates, it also provides the ability for Python programmers to provide special tags that can be used in the HTML markup to create and use Python objects directly in the template. Python developers simply extend the special CustomTag class to provide functionality whenever the corresponding tag is used in the template markup, providing yet another way for HTML Designers to take advantage of the power of Python without learning how to code!
PSE provides an extension interface to write "plugins" that allow developers to extend the functionality of PSE. Since PSE is written in Python, Python developers can extend PSE in Python and directly interface with the Apache Web Server through the mod_python interface. You can directly read incoming request headers and write outgoing response headers, preload large or often used Python modules, or keep a persistent database connection pool. The possibilities are limited only by your needs and imagination!
Using Python code, you can create modules that handle browser authorization and authentication, making it easy for applications to authenticate against any kind of database and schema. PSE simplifies the mod_python authentication handler interface, making it easier, quicker, and less error prone to handle authentication if you want to use browser based authentication mechanisms.
PSE will never cause your web server to fault, even if your servlet contains an unhandled exception. PSE has an error handling and reporting mechanism that makes it easy to see where a servlet failed, making a quick and simple debugging process. If you want more from your error reporting, PSE provides hooks to create your own custom error messages and handling routines, allowing you to create user friendly error messages, provide a bug report form, or send a servlet traceback directly to the developer through e-mail.
Using the supplied tools, developers can test and debug PSE servlets offline without the use of a web server or browser! This can significantly reduce the time it takes to develop and debug applications, since the source output of each servlet can be observed on the command line instead of rendered in a browser. With the compile utility, you can pre-compile all your servlets to optimized byte code for distribution, protecting your source code and speeding up the responsiveness of your applications!