Can waitress replace mongoose in a python web app?

53 views
Skip to first unread message

Stuart

unread,
Feb 5, 2019, 4:37:17 PM2/5/19
to pylons-discuss
As an amateur Python coder I am looking for a little help...

Having read about waitress, I feel it might be a good step up from mongoose which currently runs our Beekeeper society website.
I have installed waitress with pip install on windows 7 using Python 3.7.0.
After opening a command window and running python the command 'from waitress import serve' seemed to run ok.
The command "serve(python.exe, listen='*:8080')" results in name "python' is not defined" so not sure what to enter for wsgiapp

Also, if it can be made to work, the current code, when necessary, imports cgi
and then uses cgi.FieldStorage to obtain username and password.
Will waitress provide the same facility.

No frameworks (Flask, Django etc.) are used, as it is a relatively small society website.
It runs well under mongoose but it seems this server app. is not being maintained any more so we wish to upgrade.

Any help would be appreciated...

Best wishes to all
Stuart
 

Tres Seaver

unread,
Feb 5, 2019, 4:57:11 PM2/5/19
to pylons-...@googlegroups.com
On 2/5/19 3:38 PM, Stuart wrote:

> I have installed waitress with pip install on windows 7 using Python 3.7.0.
> After opening a command window and running python the command 'from
> waitress import serve' seemed to run ok.
> The command "serve(python.exe, listen='*:8080')" results in name "python'
> is not defined" so not sure what to enter for wsgiapp


'wsgiapp' should be any callable which conforms to PEP 3333's definition
for an application[1].

WSGI-based web frameworks aim to make writing that callable simpler, by
hiding the details of the WSGI spec. See for instance the "simplest
possible Pyramid application"[2], or the equivalent Flask application[3].


[1] https://www.python.org/dev/peps/pep-3333/#the-application-framework-side

[2] https://pyramid.readthedocs.io/en/latest/#the-pyramid-web-framework

[3] http://flask.pocoo.org/


Tres.
--
===================================================================
Tres Seaver +1 540-429-0999 tse...@palladion.com
Palladion Software "Excellence by Design" http://palladion.com

Bert JW Regeer

unread,
Feb 5, 2019, 4:59:36 PM2/5/19
to Pylons Project
Hello Stuart,

How are you currently running your application? I am not familiar with Mongoose.

Bert

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/eddb4e87-cac2-4981-8f36-5b049e1388d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stuart

unread,
Feb 5, 2019, 5:51:22 PM2/5/19
to pylons-discuss
Hello Bert

Thanks for responding.

Mongoose is a small app that you place in the same folder as your python app.
It consists of an exe file and a config file.
The config file determines the listening port and once the exe is started all calls on that port are processed.
see config example below...
The python files are generated with no reference to the server but the python library file called cgi is used to extract form data from returned pages.
It's all quite simple.
I hope this covers what you want but please don't hesitate to ask for any further info if you need any.


__________
document_root D:\Websites\ob2
listening_port 888
index_files members.py,home.py,index.py

cgi_interpreter C:\Python\Python.exe
cgi_pattern **.cgi$|**.py$
___________

Best wishes
Stuart

Theron Luhn

unread,
Feb 5, 2019, 6:24:59 PM2/5/19
to pylons-...@googlegroups.com
It looks like Mongoose is (among other things) a CGI server.

Waitress is a WSGI server, which is an alternative to CGI.  You’d need to build your site with something that speaks WSGI.  I would recommend Pyramid ;)

If you want to keep using CGI, you’ll need to find a CGI server.  Apache would probably be your best bet.  https://httpd.apache.org/docs/2.4/howto/cgi.html  https://editrocket.com/articles/python_apache_windows.html

— Theron



Reply all
Reply to author
Forward
0 new messages