3 ms·
The singlefile-ness of Bottle is no longer unique. For example, the modern day Fastapi built on async ASGI (and ranks top in framework benchmarks) is also sing
by sandGorgon 7y ago
The singlefile-ness of Bottle is no longer unique.
For example, the modern day Fastapi built on async ASGI (and ranks top in framework benchmarks) is also single file.
https://github.com/tiangolo/fastapi https://github.com/tiangolo/fastapi
or Fastapi for that matter - https://github.com/encode/starlette https://github.com/encode/starlette
However, it is a bit tricky to run Bottle with production grade servers like gunicorn/uwsgi.
- oefrha 7y agoWhat? FastAPI is certainly not single file: https://github.com/tiangolo/fastapi/tree/master/fastapi https://github.com/tiangolo/fastapi/tree/master/fastapi The issue is talking about Bottle the framework itself being a single file, bottle.py.
- sandGorgon 7y agooh my bad. That's interesting, but im not sure about utility. Because everyone literally uses package management to install and maintain bottle. Bottle has code like this - https://github.com/bottlepy/bottle/blob/master/bottle.py#L81-L84 https://github.com/bottlepy/bottle/blob/master/bottle.py#L81... - which does check for external dependencies (which predicate a package manager)
- Kwpolska 7y agoFastAPI and Starlette both have tons of files, and even subpackages. Bottle ships as only a single bottle.py file, with no external dependencies (only Python standard library). FastAPI depends on Starlette, and both have a set of optional external dependencies. > However, it is a bit tricky to run Bottle with production grade servers like gunicorn/uwsgi. Uh, no? Bottle has docs for deployment: https://bottlepy.org/docs/dev/deployment.html#switching-the-server-backend https://bottlepy.org/docs/dev/deployment.html#switching-the-... They have automated support for gunicorn. uWSGI requires adding one line (`app = bottle.default_app()`) and pointing uWSGI at that.
- oefrha 7y agoIt’s indeed strange to call any WSGI-capable framework (all of them?) tricky to deploy with gunicorn/uwsgi. All you need to do is expose the WSGI object.