Learn about Centmin Mod LEMP Stack today
Become a Member

running a python script on the web?

Discussion in 'Other Web Apps usage' started by redbot, Aug 11, 2022.

  1. redbot

    redbot Dreaming of Debmin Mod

    51
    10
    8
    Mar 30, 2020
    Ratings:
    +25
    Local Time:
    9:37 PM
    I was given two files, an .html and .py to host along with a database.

    The .html calls the .py like so:

    HTML:
    <form action="generator.py" method="post">
    When the form is submitted, I get a "405 Not Allowed" error.

    I'm not sure about hosting .py files over the web. Is this something people actually do?

     
  2. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:37 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Any documentation for that script you can link to ? What's the script for? I don't really have any experience with Python used in this way. I do know you can't run Python like that on Nginx as is without additional apps/setup AFAIK.

    Using NGINX and NGINX Plus as an Application Gateway with uWSGI and Django | NGINX Plus and Setting up Django and your web server with uWSGI and nginx — uWSGI 2.0 documentation

    from Setting up Django and your web server with uWSGI and nginx — uWSGI 2.0 documentation

     
  3. redbot

    redbot Dreaming of Debmin Mod

    51
    10
    8
    Mar 30, 2020
    Ratings:
    +25
    Local Time:
    9:37 PM
    Hah, no documentation, a friend wrote it. The script takes values posted from the .html file, runs them through the sql database, and spits them out all nice and formatted. Supposedly anyway, I haven't gotten it to work.

    Ugh, looks like I'll need an alternate port. Maybe I'll just rewrite it in php
     
    Last edited: Aug 11, 2022