User Tools

Site Tools


python:flask
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


python:flask [2024/03/07 23:45] (current) – created dblume
Line 1: Line 1:
 +====== Python Flask ======
  
 +I once hosted the following [[https://flask.palletsprojects.com/en/3.0.x/|flask]] page at flask.dlma.com. It cites [[https://www.brettsbeta.com/blog/2020/07/flask-on-dreamhost-shared-website-hosting/|Flask on Dreamhost Shared Website Hosting]]. At DreamHost, Flask required Passenger, which they discontinued.
 +
 +<file python passenger_wsgi.py>
 +import sys, os
 +INTERP = os.path.join(os.environ['HOME'], 'flask.dlma.com', 'py3venv', 'bin', 'python3')
 +if sys.executable != INTERP:
 +        os.execl(INTERP, INTERP, *sys.argv)
 +sys.path.append(os.getcwd())
 +
 +from flask import Flask
 +application = Flask(__name__)
 +
 +@application.route('/')
 +def index():
 +    return 'Hello from Passenger.\nSee https://www.brettsbeta.com/blog/2020/07/flask-on-dreamhost-shared-website-hosting/'
 +</file>
python/flask.txt · Last modified: 2024/03/07 23:45 by dblume