About This Wiki

The source code for this wiki (MoinMoin 1.8.9) may be found in extras/wikiapp.

In short, the wikiapp.MoinMoinController extension can be programmed on top of WSGI and may be deployed as a FastCGI script. The result is a multithreaded-capable wiki implementing most of the MoinMoin server code using only few lines of Python code:

   1 #!/usr/bin/env python
   2 # Copyright (c) 2007-2012 Etienne Robillard <erob@gthcfoundation.org>
   3 # All rights reserved.
   4 import sys
   5 import fastcgi
   6 import wikiapp
   7 
   8 from MoinMoin.server    import Config
   9 from notmm.utils.wsgi   import HTTPResponse
  10 
  11 app_conf = wikiapp.global_conf['wikiapp']
  12 
  13 # Check if url_prefix_static has been defined
  14 # in development.ini, otherwise use the default (/moin_static184).
  15 if 'url_prefix_static' in app_conf:
  16     url_prefix_static = app_conf['url_prefix_static']
  17 else:
  18     url_prefix_static = '/moin_static184'
  19 
  20 # Add the wikiconfig module in sys.path if not present
  21 if not 'wikiconfig' in sys.modules:
  22     sys.path.insert(-1, wikiapp.default_instance)
  23     import wikiconfig
  24 
  25 class WikiConfig(Config):
  26     """ WSGI default config """
  27     url_prefix_static = url_prefix_static
  28 
  29 def main():
  30     wsgi_app = wikiapp.WikiController(WikiConfig())
  31     server = fastcgi.ThreadedWSGIServer(wsgi_app, workers=2)
  32     server.serve_forever()
  33 
  34 
  35 if __name__ == '__main__':
  36     main()

(!) Tip: To deploy in production mode, save the script as moinmoin.fcgi under your document root then configure the webserver to handle .fcgi scripts using the FastCGI extension.


CategoryPython, HelpOnConfiguringMoinMoin

just another Wiki: DjangoHotSauce/Cookbook/WikiApp (last edited 2013-06-10 00:57:53 by EtienneRobillard)