TurboGears 2 (TG2) is an open-source, data-driven Python web framework designed for rapid development.
https://turbogears.org/
__________________________________________________________________________________________________________________
Testing Environment: Ubuntu 24.04.4 LTS Hostname - ip Address -
__________________________________________________________________________________________________________________
apt update ; apt install build-essential net-tools curl git software-properties-common python3 python3-pip python3-venv git python3-virtualenv
mkdir ~/myproject
cd ~/myproject
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install turbogears2
nano webapp.py
from wsgiref.simple_server import make_server
from tg import MinimalApplicationConfigurator
from tg import expose, TGController
# RootController of our web app, in charge of serving content for /
class RootController(TGController):
@expose(content_type="text/plain")
def index(self):
return 'Hello World'
# Configure a new minimal application with our root controller.
config = MinimalApplicationConfigurator()
config.update_blueprint({
'root_controller': RootController()
})
# Serve the newly configured web application.
print("Serving on port 8080...")
httpd = make_server('', 8080, config.make_wsgi_app())
httpd.serve_forever()
python webapp.py
http://localhost:8080
__________________________________________________________________________________________________________________
Thursday, April 9, 2026
How To Deploy TurboGears 2 On Ubuntu 24.04 LTS
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment