Introduction to the Python Bottle web framework

Source: Internet
Author: User

Bottle is a fast, simple, lightweight Python WSGI WEB framework. Single file, relying only on the Python standard library. Bottle is good for people who have a bit of a python base, because it's easy to use, as long as you have a basic Python syntax and a bit of web knowledge, you can develop a great web. Learning Python's OPS staff, do not need the Django framework, can be operational tools, after all, Django learning, more complex, long study time, we need to use Django it?

URL mapping (Routing): map URL requests to Python functions to make the URLs more concise.

Template (Templates): a fast and pythonic built-in template engine that supports templates such as Mako, JINJA2, and Cheetah.

Basic functionality (Utilities): easy access to form data, uploading files, using cookies, viewing HTTP metadata.

Development Server (server): built-in development server with support for paste, FAPWS3, Bjoern, Google App Engine,cherrypy and other WSGI-compliant HTTP servers.

Example : "Hello World"

From bottle import route, Run@route ('/hello/:name ') def index (name= "World"): Return ' <b>hello%s!</b> '% nam Erun (host= ' localhost ', port=8080)


Save it as a py file and execute it, and you can see the effect by accessing Http://localhost:8080/hello/world in your browser. It's so simple.
Single!


Introduction to the Python Bottle web framework

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.