Open ThomasWaldmann opened 2 years ago
Wasn't successful yet installing uwsgi
, but gunicorn
seems to work:
#!/usr/bin/env pypy
import multiprocessing
import gunicorn.app.base
from MoinMoin.wsgiapp import application as handler_app
class StandaloneApplication(gunicorn.app.base.BaseApplication):
def __init__(self, app, options=None):
self.options = options or {}
self.application = app
super(StandaloneApplication, self).__init__()
def load_config(self):
config = {key: value for key, value in self.options.items()
if key in self.cfg.settings and value is not None}
for key, value in config.items():
self.cfg.set(key.lower(), value)
def load(self):
return self.application
if __name__ == '__main__':
options = {
'bind': '%s:%s' % ('0.0.0.0', '8080'),
'workers': multiprocessing.cpu_count() * 2 + 1,
}
StandaloneApplication(handler_app, options).run()
CPython 2.7 is out of support since quite a while and because of that often removed from new distributions.
But there is pypy (not: pypy3) and you can use it to run moin!
https://www.pypy.org/
ubuntu 22.04:
Now you have a virtual env active with a python 2.7 compatible pypy.
Running moin:
moin will then run on
localhost:8080
(this can be changed in wikiserverconfig.py).