Bottle is a very fast and simple micro web framework for Python. Per default, it comes with a built-in WSGI server, which makes the work really easy. For example, it is an excellent framework to write a REST API for your application.
However, this built-in WSGI server doesn’t have support to SSL encrypted connections. Fortunately, it is possible to easily integrate Bottle with another web frameworks, like CherryPy, Python Paste, and others.
Thus, after some research, I have implemented a solution to run my Bottle code using the CherryPy WSGI server, with SSL enabled.
First at all, it is necessary to install the Bottle and CherryPy libraries in your system. On Ubuntu 14.04, they are available in the repository:
$ sudo apt-get update $ sudo apt-get install python-bottle python-cherrypy3 -y
After that, you will be able to grab a copy of the code in my GitHub repository: tiagohillebrandt/bottle-ssl
If you know a different way to do this, please feel free to share it on the comments 🙂
Also, if you have any suggestions or questions, please leave a comment and I will be happy to help.
Carpe diem!
Leave a Reply