Python + mod_wsgi/mod_python + Apache + user's public_html -


i'm interested in making pretty basic python webapp, literally form takes in input, calls python function on input, receives results returned function, , uses web development trickery make them pretty. i've seen numerous solutions using cherrypy, flask, bottle, web.py, of great, haven't seen example of uses apache. seem all-in-one web server framework, totally overkill me , not need. have apache running here, rather start second web server , have worry keeping running, i'd rather have apache serve app along else day long.

we have standard http://myserver.com/~user/ setup public_html dirs in /home/user, life of me can't figure out how create page calls python function served , has python code execute when browsing http://myserver.com/~user/. let's assume moment mod_python or mod_wsgi setup correctly...what need on end? need call script via php exec(), me defeats need mod_python in first place, or there more elegant solution (that uses mod_python)?

your concept of python scripts totaly wrong. don't treat them php scripts can have

<html> <?php echo "<title>hello world</title>"; ?> </html> 

an mod_php parse , execute php code form final html page.

it's better have python application mod_python , mod_wsgi provides interface (gateway) apache communicate application.

i have been asked quite lot of times if 1 can write python web application without framework. of course can have deal http meet , bones headers , respones codes. @ http://lucumr.pocoo.org/2007/5/21/getting-started-with-wsgi/.

so i'd suggest using framework.

if don't want mess running application deamon at, example, page http://flask.pocoo.org/docs/deploying/mod_wsgi/. shows how run flask app apache , mod_wsgi.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -