python plesk

Connect to the server via SSH

Install mod_wsgi Apache module:(apt-get install libapache2-mod-wsgi)

Restart Apache service: (systemctl restart apache2 For Debian based OS:)

Under Domains > > Apache & nginx Settings > Additional directives for HTTP specify the following:

Note: Duplicate it to the field Additional directives for HTTPS if necessary:

WSGIScriptAlias /python /var/www/vhosts/

pip install virtualenv

cd python

virtualenv venv

source venv/bin/activate

pip install flask

dans /python/

from flask import Flask, render_template, url_for, request, flash
application = Flask(__name__)

def hello():
return render_template('base.html')

def hellohello():
return 'Hello, World'