Skipole WSGI generator.

Topics:

Introduction Getting Started Your Code skiadmin start_call submit_data end_call Exceptions PageData SectionData skicall Serving wsgi Code Examples

Development at GitHub:

github.com/bernie-skipole/skipole

skiadmin

Having created a project with:

python3 -m skilift myproj /path/to/my/projectfiles

Inspect the file /path/to/my/projectfiles/myproj.py, and you will see it contains the application:

    application = WSGIApplication(project='myproj',
                                  projectfiles=PROJECTFILES,
                                  proj_data={},
                                  start_call=start_call,
                                  submit_data=submit_data,
                                  end_call=end_call,
                                  url="/",
                                  proj_ident=None)

You will also see that a skiadmin sub-project has been added:

############### THESE LINES IMPORT SKILIFT AND ADD THE SKIADMIN SUB-PROJECT #
############### AND SHOULD BE REMOVED WHEN YOU DEPLOY YOUR APPLICATION #

## The skilift package is only needed for development, it is not needed
## for your finished application


if __name__ == "__main__":

    set_debug(True)

    from skilift import make_skiadmin, development_server

    skiadmin_application = make_skiadmin(editedprojname=PROJECT, examples="http://www.webparametrics.co.uk/skiwidgets/")
    application.add_project(skiadmin_application, url='/skiadmin')

    # the skiadmin sub project can now be used to edit your application
    # please note: when being used to edit a project in this way, skilift requires the
    # application to be the root application, and to have proj_ident to be set to the
    # project name ( or set to None which automatically does this )

    # serve the application with the development server from skilift

    host = "127.0.0.1"
    port = 8000
    print("Serving %s on port %s. Call http://localhost:%s/skiadmin to edit." % (PROJECT, port, port))
    development_server(host, port, application)
 

This code does three things, it calls set_debug(True), which gives enhanced error reporting, it creates a project 'skiadmin' which is added to your own project at url '/skiadmin', and it runs your application on a development web server.

Both your project, and the skiadmin sub project are served and can be accessed by your web browser. Skiadmin provides a web based method of adding pages and widgets to your web site.

Finally, when you deploy your code to a live web site, you would delete the above lines, so that the skiadmin sub project is no longer served.

skiadmin allows you to add pages of different types, and edit them, typically 'template' pages containing widgets, and 'responder' pages which accept incoming requests from the user, then calls your code, and passes the results to a template page, which is returned to the client.

The pages added by skiadmin are given 'idents' being (projectname, pagenumber) and labels mapping a name to these idents can be created. 'sections' can also be created, which can also contain widgets, and can be inserted into template pages, and 'textblocks' can be made which contain either plain text or your own html code.

When you create or alter any page, ensure you choose the 'Save' option to make your changes permanent, and when you change your Python code you need to restart the web server.

The main admin page.

First admin page

Further skiadmin features are described below:

Screenshots of the web pages

Navigation

Root