bowiecao Posted January 15, 2018 Share Posted January 15, 2018 Hi, I followed the wiki page and try to run a flask app on Tommy. It shows 500 error. Please help me, thanks! .htaccess ( ASCII text )/home/bowiecao/public_html/flask/.htaccessRewriteEngine OnRewriteBase /RewriteRule ^(media/.*)$ - [L]RewriteRule ^(admin_media/.*)$ - [L]RewriteRule ^(flask\.wsgi/.*)$ - [L]RewriteRule ^(.*)$ flask/flask.wsgi/$1 [QSA,PT,L] flask.wsgi ( Python script, ASCII text executable )#!/usr/bin/python3.6 version 3.6.1import os, sys# edit your username belowsys.path.append("/home/bowiecao/public_html/flask");sys.path.insert(0, os.path.dirname(__file__))from myapp import app as application# make the secret code a little betterapplication.secret_key = 'secret' myapp.py ( Python script, ASCII text executable )#!/usr/bin/python3.6 version 3.6.1import sysfrom flask import Flask, __version__app = Flask(__name__)application = app@app.route("/")def hello(): return "hello world"if __name__ == "__main__": app.run() Quote Link to comment Share on other sites More sharing options...
Krydos Posted January 15, 2018 Share Posted January 15, 2018 Here is the contents of your .htaccess file /home/bowiecao/public_html/flask/.htaccess RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] RewriteRule ^(flask\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ flask/flask.wsgi/$1 [QSA,PT,L] That first line is causing an error because it is not a valid .htaccess command. I removed it for you and your "hello world" flask app is working now. http://little-chicken.heliohost.org/flask/ Quote Link to comment Share on other sites More sharing options...
bowiecao Posted January 15, 2018 Author Share Posted January 15, 2018 thanks so much! Quote Link to comment Share on other sites More sharing options...
Luigi123 Posted January 15, 2018 Share Posted January 15, 2018 Moved to Website Management and Coding. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.