devwiki:python_web

Differences

This shows you the differences between two versions of the page.


devwiki:python_web [2021/08/28 07:51] (current) – created ying
Line 1: Line 1:
 +====== Python Web CGI Programming Start ======
 +
 +  * To get everything working for your App.py on web, you need
 +    - Make sure your Web server has register handler for Py file as cgi-script file, mostly likely hosting provide that support python already add that handler, but for local test like xampp, make sure Apache config setting has .py included like this <code>
 +AddHandler cgi-script .cgi .pl .asp .py
 +</code>
 +    - add your server python version path to first line of App.py,
 +      - linux example: <code python>#!/usr/bin/python</code>
 +      - windows example: <code python>#!C:/Python27/python</code>
 +    - put your App.py in cgi-bin folder in your web host or other place
 +    - after upload, change file permission to 755
 +
 +  * start ref:
 +    * https://wiki.python.org/moin/CgiScripts
 +    * php call python subprocess way vs CGI way: 
 +      * https://stackoverflow.com/questions/14047979/executing-python-script-in-php-and-exchanging-data-between-the-two
 +
 +====== Web System Optimize ======
 +
 +  * https://developer.yahoo.com/performance/rules.html