Jump to content

Recommended Posts

Posted

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]

 

text-x-generic.png 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'

 

text-x-generic.png 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()

 

Posted

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/

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
×
×
  • Create New...