[Python] Using Python like PHP in Apache/Windows

Discussão em 'Python' iniciado por Stack, Maio 28, 2025.

  1. Stack

    Stack Membro Participativo

    I understand that I should use mod_wsgi to run Python, and I have been trying to get that set up, but I'm confused about it:

    This is a sample configuration I found for web.py:

    LoadModule wsgi_module modules/mod_wsgi.so

    WSGIScriptAlias /appname /var/www/webpy-app/code.py/

    Alias /appname/static /var/www/webpy-app/static/
    AddType text/html .py

    <Directory /var/www/webpy-app/>
    Order deny,allow
    Allow from all
    </Directory>


    So... I understand I have to configure my web server to point to the python application? Isn't there a way to use it like PHP, where, when you request a .py file, Python interprets it? How can I get my web server to the very basic state, where I can upload a file containing print "Hello World", request it, and have it say "Hello World"?

    Continue reading...

Compartilhe esta Página