So I want to get into React Native development and have decided Python to be my backend, but for some reason I cannot configure the Apache correctly. The only way to successfully get the result from the request is to include path to python.exe at the start of the document like so:
!C:\Users\Name\PycharmProjects\AppName\venv\Scripts\python.exe
But the problem is that the file is than executed by the Python console, and if I want to access it via mobile phone I get this error:
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
So my question is:
Is there any way in which I can configure Apache to execute a file, without the requirement of the py console, so the request might be handled by devices, which doesn't have a Python console installed?
mod_cgiormod_fcgiormod_pythonin Apache? Or maybe use more popular method and use any web framework like Flask/Django instead of using Apache.cgi-bin/so first you can try t put code in this folder. On Linux script would need shebang#!/usr/bin/env pythonin first line and it should be executable -chmod a+x script.pyhttp://192.168.1.3/HelloWorld.pyon server (with CGI) then code should be executed on server, not on mobile device. If CGI doesn't work then server may try to send code as normal file and then mobile may try to run it locally but it is wrong - CGI server should run code on server. At start I would put code in subfoldercgi-binto run it ashttp://192.168.1.3/cgi-bin/HelloWorld.pybecause most CGI servers as default run code only in this subfolder.print("Hello World")may generate wrong data and it may have problem to send it. You should have it in any tutorial for CGI scripts. See module cgi