Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using other WSGI servers #31

Open
joncodis opened this issue Apr 1, 2013 · 0 comments
Open

Using other WSGI servers #31

joncodis opened this issue Apr 1, 2013 · 0 comments

Comments

@joncodis
Copy link

joncodis commented Apr 1, 2013

I had no issues getting this great project to run on Apache, but I wanted to use something more lightweight. Tried a few different servers, but application would not run properly. I am not a Python programmer, but hacked at it and got it to work on FAPWS (https://www.fapws.org/) and CherryPy (https://docs.cherrypy.org/stable/refman/wsgiserver/init.html).

Providing my diff below...such as it is, in case it is of any interest. Works for me, but I'm sure some better fixes could be made.

Patch to _init_.py

123c123,124

< raise Exception("Internal error: no / at the beginning of %s" % path)

        path = '/' + path
        # raise Exception("Internal error: no / at the beginning of %s" % path)

398c399

< return self.query(start_response, Request(environ), pure_path, client, format, resolver,

        return self.query(start_response, Request(dict(environ)), pure_path, client, format, resolver,

CherryPy test server code..

!/usr/bin/env python

from cherrypy import wsgiserver
import DNSLG

port = 8080
email_admin = "foobar@invalid"
url_doc = None
url_css = None

querier = DNSLG.Querier(email_admin, url_doc, url_css)
wsgi_app = querier.application

server = wsgiserver.CherryPyWSGIServer(('0.0.0.0', 8080), wsgi_app, request_queue_size=500, server_name='localhost')

if name == 'main':
try:
server.start()
except KeyboardInterrupt:
server.stop()

FAPWS test server code

!/usr/bin/env python

import fapws._evwsgi as evwsgi
from fapws import base
from fapws.contrib import cgiapp
import DNSLG

port = 8080
email_admin = "[email protected]"
url_doc = None
url_css = None

def start():
evwsgi.start("0.0.0.0", "8080")
evwsgi.set_base_module(base)

querier = DNSLG.Querier(email_admin, url_doc, url_css)
evwsgi.wsgi_cb(("/",querier.application))

evwsgi.set_debug(0)
evwsgi.run()

if name=="main":
start()

@joncodis joncodis closed this as completed Apr 1, 2013
@joncodis joncodis reopened this Apr 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant