未加星标

An introduction to CherryPy, a lightweight Python web framework

字体大小 | |
[开发(python) 所属分类 开发(python) | 发布者 店小二03 | 时间 2019 | 作者 红领巾 ] 0人收藏点击收藏

CherryPy is an open source, fast, and stable python web framework that allows the developers to build the web applications. The developers can build the web applications as the way they would build the other object-oriented python programs. Many developers still haven’t heard this simple,

yet powerful framework, because it is not a complete stack with built-in support for a multi-tier architecture. The developers of CherryPy call it as pythonic framework, because it closely follows the conventions of Python.

Features

Simplicity Developing applications is much easier than anyother frameworks. You don’t have to learn the entire framework to develop a application.

Powerful Hence, it follows the conventions of Python, the CherryPy applications are as like as regular Python applications. You don’t need to learn a new language. If you’re a Python programmer, then CheeryPy is easy to use.

Built-in web server It Includes its own web server to host your application. Also, you can use any other popular web servers like Apache or nginx.

It is completely free and open source.

What's the one thing every developer wants? More screens! Enhance your coding experience with anexternal monitor to increase screen real estate.

Installation

Make sure you have installed the most recent version of python-pip. If you didn’t install python-pip yet, use the following command.

On Debian based systems:

sudo apt-get install python-pip

On RPM based systems:

yum install python-pip

After installing python-pip, install CherryPy using the following commands with root user privileges:

pip install cherrypy

Or

easy_install cherrypy

You can verify the successful installation of CherryPy using the following command. CherryPy comes with some sample tutorials. So, you can test them as shown below.

python -m cherrypy.tutorial.tut01_helloworld

Sample Output:

[18/Oct/2014:18:09:01] ENGINE Listening for SIGHUP. [18/Oct/2014:18:09:01] ENGINE Listening for SIGTERM. [18/Oct/2014:18:09:01] ENGINE Listening for SIGUSR1. [18/Oct/2014:18:09:01] ENGINE Bus STARTING [18/Oct/2014:18:09:01] ENGINE Started monitor thread ‘_TimeoutMonitor’. [18/Oct/2014:18:09:01] ENGINE Started monitor thread ‘Autoreloader’. [18/Oct/2014:18:09:01] ENGINE Serving on http://127.0.0.1:8080 [18/Oct/2014:18:09:01] ENGINE Bus STARTED

Now, open your web browser, and point it to http://127.0.0.1:8080/. You’ll see the “Hello world” message in your browser. Since I don’t have GUI mode in my server, I accessed the test page using command “lynx http://127.0.0.1:8080/” from my Terminal.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch . Free Download

本文开发(python)相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程

代码区博客精选文章
分页:12
转载请注明
本文标题:An introduction to CherryPy, a lightweight Python web framework
本站链接:https://www.codesec.net/view/627727.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(python) | 评论(0) | 阅读(207)