Skipole WSGI generator.


Introduction Getting Started start_call submit_data end_call skicall skicall.page_data

Development at Bitbucket:

Skipole Project Documentation Downloads

Your project Python code

The projectfiles directory containing project myproj should have been created as previously described. Within it you will be developing ...projectfiles/myproj/code/ will already be set up to do most of the following work, but in summary, it needs to import the WSGIApplication class.

Creating an instance of this WSGISpplication object creates an 'application' which can be used by any WSGI web server.

An instance is created by:

    from skipole import WSGIApplication
    application = WSGIApplication(project='myproj',

Where 'PROJECTFILES' is the path to your projectfiles directory - this informs the object where the project JSON files can be found.

start_call, submit_data and end_call are four functions that you will provide, they are called during the progress of a call:

start_call(called_ident, skicall)

start_call is called when the server initially receives an incoming call.


submit_data is called by Responder pages.

end_call(page_ident, page_type, skicall)

end_call is called after any Responders have handled the call and prior to returning the page.

These functions can in turn call on any further modules you wish to include within the package - hence you can access your own databases and functionality.

You will notice the framework passes the skicall object to your functions which contains a good deal of information you will need, more about it is given here:skicall

In particular your functions will modify the skicall.page_data attribute which will set field values in the page finally returned to the client. For further details:skicall.page_data

Before the application is ready, it needs to have the application from the 'skis' project added to it. This is done with:

    skis_code = os.path.join(PROJECTFILES, 'skis', 'code')
    if skis_code not in sys.path:
    import skis
    skis_application = skis.makeapp(PROJECTFILES)
    application.add_project(skis_application, url='/lib')

This 'skis' application serves javascript files used by the framework, so it is always needed.


Your module also imports four exceptions which you can use in your functions:

from skipole import FailPage, GoTo, ValidateError, ServerError

Further information about the exceptions and their arguments can be found at:

FailPage(message = '', section='', widget='')

GoTo(target, clear_submitted=False, clear_page_data=False)

ValidateError(message = '', section='', widget='', status='400 Bad Request')

ServerError(message = '', section='', widget='', status='500 Internal Server Error', code=0)

Further information is available within the admin web pages.