baidoc

Flask using Python

Recommended Posts

Hello,

Has anyone managed to install Flask on their cPanel Web Hosting? I've been trying to install the Flask on my Hawk Host Shared Hosting using Python but I'm getting "500 Internal Error The server encountered an unexpected condition which prevented it from fulfilling the request." I've been following the exact guide from here: https://blog.ouseful.info/2016/09/17/creating-a-simple-python-flask-app-running-on-reclaim-hosting/

 

myapp.py: 

from flask import Flask
app = Flask(__name__)
application = app # our hosting requires application in passenger_wsgi

@app.route("/")
def hello():
return "This is Hello World!\n"

if __name__ == "__main__":
app.run()

 

passenger_wsgi.py:

from myapp import application

 

I'd appreciate your help guys. 

Thank you!

Share this post


Link to post
Share on other sites

At this time you'd need to have our team look at the web server logs to determine why the Python application does not work.  We're working with the Litespeed team on a more elegant solution which will work similar to that of PHP's error_log file.  At this time though no estimate on when that'll be available but it is definitely something that will be coming as Python and Ruby applications become more popular on our shared web hosting they need ways to debug them without opening support tickets.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now