• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Question How to run Python script on Apache web hosting server using Plesk Onyx

Centurion

New Pleskian
Hello,

I have written a web scraping Python script importing bs4, requests, os and other libraries. This script is scraping several websites, processing the soups and creating new HTML files in another folder with the outputs of the script as the content. The main HTML of my webhosting is then loading the content of these newly created HTML files into a <div>.
It works perfectly running in the local IDE.

My (linux) webhosting with Plesk Onyx 17.8.11 is supporting Python 3. The standard "Hello World!" python script in the cgi-bin folder is working and displayed correctly in the browser - meaning Python is functioning.

But as soon as I am trying to put the first lines of my Python script, importing the libraries, the result is immediately displaying an "500 Internal Server Error" page. The permissions of that "Python-CGI"-page are set for both owner and groups as "rwx" (in the Plesk GUI). How to make sure and check the permissions of that script? (e.g. 755)

I assume that my Python script is not working in a "pure CGI"-python page?
Nothing has to be "printed out" or displayed in the browser - the script is only creating/writing HTML files.
Am I forced to use a framework like Flask?
If so, how to install Flask in Plesk and implement my Python script?

I searched both in this forum and Google for similiar cases but could not find helpful stuff.
 
Back
Top