MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 1 as of 2013-12-29 19:07:21
  • Python
  • CherryPy

CherryPy

Pythonic, object-oriented web framework

http://www.cherrypy.org/

Install on Slackware 14

  • wget https://pypi.python.org/packages/source/C/CherryPy/CherryPy-3.2.4.tar.gz

  • cp CherryPy-3.2.4.tar.gz /tmp

  • cd /tmp
  • tar xvzf CherryPy-3.2.4.tar.gz

  • python setup.py build
  • python setup.py install

Check installation

python
Python 2.7.3 (default, Jul  3 2012, 21:16:07) 
[GCC 4.7.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cherrypy
>>> cherrypy.__version__
'3.2.2'
>>> quit()

CherryPy test web app

Create file /var/www/htdocs/cherrypytest/cherrypytest.wsgi

   1 import sys
   2 sys.stdout = sys.stderr
   3 import cherrypy
   4 
   5 cherrypy.config.update({'environment': 'embedded'})
   6 
   7 class HelloWorld(object):
   8     @cherrypy.expose
   9     def index(self):
  10         return "Hello World CherryPy!!!!"
  11     @cherrypy.expose
  12     def add(self,param1,param2):
  13        return str( int(param1)+int(param2) )
  14 
  15 hello = HelloWorld()    
  16 application = cherrypy.Application(hello, script_name=None, config=None)

Create entry in /etc/httpd/vhosts.conf

  • WSGIScriptAlias / /var/www/htdocs/cherrypytest/cherrypytest.wsgi

Add entry in /etc/hosts

  • 127.0.0.1 localhostcherrypytest

Restart apache

  • /etc/rc.d/rc.httpd restart

Open url http://localhostcherrypytest/

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01