Mercurial > hatta
changeset 2467:860bf8d088d2
added example fcgi script with gzip compression support via external middleware
| author | Vlad Glagolev <scm@vaygr.net> |
|---|---|
| date | Mon, 11 May 2015 11:44:15 +0300 |
| parents | 101db775ab75 |
| children | fa6115f52c07 |
| files | examples/hatta.gzip.fcgi |
| diffstat | 1 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/hatta.gzip.fcgi Mon May 11 11:44:15 2015 +0300 @@ -0,0 +1,22 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +from flup.server.fcgi import WSGIServer +# uses https://bitbucket.org/lcrees/wsgigzip/ +from wsgigzip.gzip import GzipMiddleware +import hatta + +config = hatta.WikiConfig( + pages_path = '/path/to/pages/', # edit this + cache_path = '/path/to/cache/', # edit this + template_path = '/path/to/templates/', # optional + pygments_style = 'autumn', # optional + subdirectories = True # optional +) + +config.parse_args() +config.parse_files() +config.sanitize() +wiki = hatta.Wiki(config) + +WSGIServer(GzipMiddleware(wiki.application)).run()
