Wednesday, April 8, 2026

How To Deploy Bottle Micro Framework On Ubuntu 24.04.4 LTS

 Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. It is distributed as a single file module and has no dependencies ||
https://bottlepy.org/docs/dev/
__________________________________________________________________________________________________________________
Testing Environment: Ubuntu 24.04.4 LTS                   Hostname - jitsi.tutorial.com                      ip Address - 
__________________________________________________________________________________________________________________
apt update ; apt install build-essential net-tools curl git software-properties-common zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev liblzma-dev python3.12-venv python3-pip -y


apt install python3.12-venv -y
python3 -m venv myproject
source myproject/bin/activate
pip install bottle
pip freeze > requirements.txt
deactivate

nano hello.py
from bottle import route, run

@route('/')
def index():
    return "Hello, World!"

run(host='0.0.0.0', port=8080)

chmod 777 hello.py 
python hello.py
__________________________________________________________________________________________________________________

No comments:

Post a Comment