In our work we use the wsgi specification to run python scripts.

WSGI is the gateway between the python application and the web server. Many Python frameworks have implemented code to handle the wsgi interface, such as Django, Flask and many others, so you can simply put the wsgi script in the application folder to run the application.

To run a Python application you must first create a virtual environment with the Python version you want.

All this can be done in the hosting control panel DirectAdmin, section: “Setup Python App”

How do I run Python scripts?

Next, you need to create your application by clicking on the appropriate button.

How do I run Python scripts?

After that, enter data about your application, namely:

Select the desired version of Python, then enter the path to your application (the directory where the script will lie) and select a domain name where you plan to run the application, you can also specify the path relative to the domain if you want to run the application only in a particular directory domain, without affecting the main domain.

If desired, you can specify the name of the script that will be the starting point in the application launch file (by default the script should be called passenger_wsgi.py), and the name of the object (entry point to the application) in the script code which will be responsible for sending the response to the web server (by default the application function)

How do I run Python scripts?

When you click on create in the folder with the application will be created file passenger_wsgi.py with an example of output “Hello world”, then you can work with this script or write your own, for example taken from the framework.

 Hosting
Total 0 Votes:
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?