Learn about Centmin Mod LEMP Stack today
Register Now

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 Premium Member

    47
    10
    8
    Mar 30, 2020
    Ratings:
    +23
    Local Time:
    8:30 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

    49,299
    11,296
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,575
    Local Time:
    11:30 AM
    Nginx 1.21.x
    MariaDB 10.x
    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 Premium Member

    47
    10
    8
    Mar 30, 2020
    Ratings:
    +23
    Local Time:
    8:30 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