Skip to main content

Next generation TurboGears

Project description

https://github.com/TurboGears/tg2/actions/workflows/run-tests.yml/badge.svg https://coveralls.io/repos/TurboGears/tg2/badge.svg?branch=development https://img.shields.io/pypi/v/TurboGears2.svg https://img.shields.io/pypi/pyversions/TurboGears2.svg https://img.shields.io/pypi/l/TurboGears2.svg https://www.codetriage.com/turbogears/tg2/badges/users.svg https://img.shields.io/gitter/room/turbogears/Lobby.svg https://img.shields.io/twitter/follow/turbogearsorg.svg?style=social&label=Follow

TurboGears is a hybrid web framework able to act both as a Full Stack framework or as a Microframework. TurboGears helps you get going fast and gets out of your way when you want it!

TurboGears can be used both as a full stack framework or as a microframework in single file mode.

The following content covers examples in minimal mode, to see an example for full stack capabilities take a look at tg.devtools

Get Started

https://asciinema.org/a/181221.png

To try TurboGears just get pip if you don’t already have it:

$ curl -O 'https://bootstrap.pypa.io/get-pip.py'
$ python get-pip.py

And install Turbogears:

$ pip install TurboGears2

Then serving a TurboGears web application is as simple as making a webapp.py file with your application:

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()

Start it with python webapp.py and open your browser at http://localhost:8080/

Want to play further with TurboGears? Try the TurboGears Tutorials:

Support and Documentation

Visit TurboGears Documentation for complete documentation and tutorials.

See the TurboGears website to get a quick overview of the framework and look for support.

License

TurboGears is licensed under an MIT-style license (see LICENSE.txt). Other incorporated projects may be licensed under different licenses. All licenses allow for non-commercial and commercial use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

turbogears2-2.5.0.tar.gz (159.4 kB view details)

Uploaded Source

Built Distribution

TurboGears2-2.5.0-py3-none-any.whl (153.7 kB view details)

Uploaded Python 3

File details

Details for the file turbogears2-2.5.0.tar.gz.

File metadata

  • Download URL: turbogears2-2.5.0.tar.gz
  • Upload date:
  • Size: 159.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for turbogears2-2.5.0.tar.gz
Algorithm Hash digest
SHA256 d21aeab942263423b9bdf4949f5db28d0485c4f6b82a0c241c256aa9d90ab63a
MD5 8e1ca6975d3004b5920c10f2fc8dc5b3
BLAKE2b-256 f0431c010569b4975c9cc5443aba1a70f8c4989b71731617d8d64d1b541968d3

See more details on using hashes here.

File details

Details for the file TurboGears2-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: TurboGears2-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 153.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for TurboGears2-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3cefec42f5da9daec91dfe47dee542dac7828df858028509a54e0f2e48f309f
MD5 4ab96b43bb889fe75634b57d272d6616
BLAKE2b-256 6711c0cdfa5e906fd73f1830f9b52ed14c4751ac054fcefd5b23de74f8bed285

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page