Discussion:
[bottlepy] bottle with current (10.*) cherrypy
tomasz bandura
2017-01-31 15:02:11 UTC
Permalink
Hello,

For standard bottle app configuration with installed current cherrypy
server:

run(app,..., server='cherrypy')

bottle raises an exception:

Traceback (most recent call last):
File "C:\opt\Python27\lib\site-packages\bottle.py", line 3123, in run
server.run(app)
File "C:\opt\Python27\lib\site-packages\bottle.py", line 2787, in run
from cherrypy import wsgiserver
ImportError: cannot import name wsgiserver


I've checked cherrypy and it looks wsgisever now is not a part of cherrypy (was moved to cheroot project from 9.0 version)
I'm not sure if it is change request?

Regards,
Tomasz
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lars van Gemerden
2017-04-27 10:45:08 UTC
Permalink
exact same problem here
Post by tomasz bandura
Hello,
For standard bottle app configuration with installed current cherrypy
run(app,..., server='cherrypy')
File "C:\opt\Python27\lib\site-packages\bottle.py", line 3123, in run
server.run(app)
File "C:\opt\Python27\lib\site-packages\bottle.py", line 2787, in run
from cherrypy import wsgiserver
ImportError: cannot import name wsgiserver
I've checked cherrypy and it looks wsgisever now is not a part of cherrypy (was moved to cheroot project from 9.0 version)
I'm not sure if it is change request?
Regards,
Tomasz
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
henningblunck via bottlepy
2018-03-19 12:49:42 UTC
Permalink
I had the same problem and managed to solve it based on the Code posted here
<https://github.com/nickbabcock/bottle-ssl/blob/master/main.py.>.

Apparently, you import the wsgi module from cheroot and then create a new
server adapter (extending the ServerAdapter Baseclass in bottlepy). This
class can then be passed as the "server" parameter to the normal bottlepy
run() function. Here is my code. I currently do not use the SSL Features.

from bottle import debug, run, ServerAdapter
from cheroot import wsgi
from cheroot.ssl.builtin import BuiltinSSLAdapter

# Server implementation and interplay with bottlepy based on
# https://github.com/nickbabcock/bottle-ssl/blob/master/main.py
class SSLCherryPyServer(ServerAdapter):
def run(self, handler):
server = wsgi.Server((self.host, self.port), handler)
#server.ssl_adapter = BuiltinSSLAdapter('cacert.pem', 'privkey.pem')

# By default, the server will allow negotiations with extremely old protocols
# that are susceptible to attacks, so we only allow TLSv1.2
#server.ssl_adapter.context.options |= ssl.OP_NO_TLSv1
#server.ssl_adapter.context.options |= ssl.OP_NO_TLSv1_1

try:
server.start()
finally:
server.stop()

debug(True)
if __name__ == '__main__':
port = int(os.environ.get("PORT", 8080))
run(app, reloader=True, host='0.0.0.0', port=port, server=SSLCherryPyServer)
Post by Lars van Gemerden
exact same problem here
Post by tomasz bandura
Hello,
For standard bottle app configuration with installed current cherrypy
run(app,..., server='cherrypy')
File "C:\opt\Python27\lib\site-packages\bottle.py", line 3123, in run
server.run(app)
File "C:\opt\Python27\lib\site-packages\bottle.py", line 2787, in run
from cherrypy import wsgiserver
ImportError: cannot import name wsgiserver
I've checked cherrypy and it looks wsgisever now is not a part of cherrypy (was moved to cheroot project from 9.0 version)
I'm not sure if it is change request?
Regards,
Tomasz
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...