A
A
Andrey Barbolin2020-01-10 00:15:23
Python
Andrey Barbolin, 2020-01-10 00:15:23

How to run python script by url?

There is a script written in python3. The device makes an http request like 10.0.0.1/search.action (the request cannot be configured on the device).
The server is running apache and the search.py ​​script is in the DocumentRoot.

DocumentRoot /var/www
<Directory "/var/www">
                Options +ExecCGI
                AddHandler cgi-script .py
        </Directory>

When executing a request in a browser like 10.0.0.1/search.py , the script executes and returns data.
How to configure apache so that when 10.0.0.1/search.action is requested, it would execute the search.py ​​script?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-01-10
@dronmaxman

https://python-scripts.com/question/13093
and also
https
://www.howtoforge.com/embedding-python-in-apa...
but in general a rare case

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question