Cannot run python Flask app cPanel using PhusionPassenger

52 Views Asked by At

I am unable to run my flask app in cpanel

My passenger_wsgi.py is

import os
import sys

from app import app

application = app


sys.path.insert(0, os.path.dirname(__file__))

and my app.py is

from flask import Flask, render_template

app = Flask(__name__, template_folder="static") # "index.html" is in static folder

@app.route('/')
def home():
    return render_template('index.html')

if __name__ == '__main__': # Even tried removing this two lines but no change
    app.run(debug=True)

Python version used 3.11.4

Flask version used 3.0.0

It also works locally.

In the error section I am getting

[ E 2023-11-04 03:08:30.0399 3259818/T47 age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /home/tyj6prmi0i7p/repositories/axel: The application process exited prematurely.

I even ensured all the folder permissions are 0755 and file permissions are 0644.

This is shown when I open the website.

enter image description here

0

There are 0 best solutions below