Jump to content

Internal Server Error


Recommended Posts

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()

 

Link to comment
Share on other sites

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/
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...