There are a lot of Python web frameworks, web.py is a lightweight Python web framework. She doesn't use a lot of one.
But it does not hinder her simple and practical. It's best to build an embedded Web server.
The following is the author of the construction process to do an introduction:
1. Download Python 2.7.8, do cross-compiling, need to make changes according to your own platform:
./configuremake python parser/pgenmv python python_for_build;mv parser/pgen parser/pgen_for_buildmake distcleanpatch- P1 < python-2.7.8-xcompile.patch./configure--host=powerpc-linux--build=x86_64--prefix=/home/myapp/ Python-2.7.8/powerpc--disable-ipv6 ac_cv_file__dev_ptmx=no Ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes --enable-sharedexport rfs=/home/newsys/rootfsmake--jobs=8 cflags= "-g0-os-s-i${rfs}/usr/include-fdata-sections- Ffunction-sections "ldflags= '-l${rfs}/usr/lib-l${rfs}/lib ' make Install#sudo make install Destdir=${rfs} PATH=" ${PATH }"
Python-2.7.8-xcompile.patch is a patch that can be downloaded from my downloads, and other similar "AC_CV_FILE__DEV_PTC" are pressed
The actual situation added, I hope you do not encounter too many compile or configuration problems----------final Python target platform installation package
2. web.py and Flup
Download version 0.37 of web.py, seemingly can be directly in the Python environment of the PC, build Web.py,flup,setuptools, and then copy to the target machine corresponding directory,
For example:/usr/lib/python2.7/
Flup Support: Python setup.py
Setuptools Support: Python Setuptools-0_6c11-py2.7.egg
The author made a resource containing three, for reference. You can download it from the download resource area
3. Lighttp Environment
The following is a key part of the lighttpd.conf file, where the author puts the code in the/home/www/directory
Fastcgi.server = ("/code.py" = ( "Socket" = "/tmp/fastcgi.socket", "bin-path" = "/home/www/" code.py ", " max-procs "= 1, " Bin-environment "( " Real_script_name "and" "" ), " Check-local "=" Disable ")) Url.rewrite-once = ( " ^/(. *) $ "="/code.py/$1 ")
4. Problems you may encounter:
"Child exited with status 127 ...
This is caused by the window newline character, all converted to UNIX format using notepad++ or similar tools
"Pcre support was missing, please install Libpcre and the headers
Pcre Library support, cross-compiling pcre can be
"Ensures that code.py has an executable attribute
5. Problems with the session
web.py session using the process, I found that there are always problems, occasionally do not respond to requests, internal server error. Found
An exception occurred in the session section.
Because Web requests are multi-process, two Web requests need to be synchronized if they both read and write to the server-side session file. and web.py
And did not do this deal.
Modify web.py session.py:
1) Add a thread lock
2) read/write synchronization
Using web.py to build a server