These are chat archives for cherrypy/cherrypy

8th
Jun 2018
bmxp
@bmxp
Jun 08 2018 09:50
Stupid question -- my cherrypy listens both on the port it is supposed to (0.0.0.0:8980) and also on 127.0.0.1:8080, even though it is configured by importing cherrypy and using the cherrypy.quickstart with a conf dictionary that has { 'server.socket_host':'0.0.0.0', 'server_socket_port':8980 }

in cherrypy/init.py starting at line 147

engine.signals = _HandleSignalsPlugin(engine)


server = _cpserver.Server()
server.subscribe()

There is a server created which listens at port 8080.

You can test it:

>>> import cherrypy
>>> cherrypy.server.socket_port
8080
>>> cherrypy.server.socket_host
'127.0.0.1'
bmxp
@bmxp
Jun 08 2018 09:57
Not sure if this helps, though...
Sviatoslav Sydorenko
@webknjaz
Jun 08 2018 10:41
have you tried to cherrypy.server.unsubscribe() first?
Amin Mkh
@AminMkh
Jun 08 2018 20:00
greetings all, I wonder what is your application structure look like, considering cherrypy doesn't force specific structure
Jason R. Coombs
@jaraco
Jun 08 2018 21:03
@AminMkh Here’s an application I built many years ago - https://github.com/jaraco/recapturedocs/blob/master/recapturedocs/server.py; I’d probably do things somewhat differently today, but mostly the same - Controllers and Models together as one service.