python plesk

https://support.plesk.com/hc/en-us/articles/115000248869-How-to-configur...


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 > example.com > 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/example.com/httpdocs/python/

pip install virtualenv

cd python

virtualenv venv

source venv/bin/activate

pip install flask

dans /python/app.py:

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

@application.route("/")
def hello():
return render_template('base.html')

@application.route('/hello')
def hellohello():
return 'Hello, World'