patents Posted March 30, 2018 Posted March 30, 2018 (edited) I am trying to deploy flask app on subdomain say testings. this is my .htaccess. RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] RewriteRule ^(flask\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ flask/flask.wsgi/$1 [QSA,PT,L]This is my flask.wsgi import os, sys # edit your username below sys.path.append("/home/username/public_html/flask"); sys.path.insert(0, os.path.dirname(__file__)) from myapp import app as application # make the secret code a little better application.secret_key = '<removed>'when I visit using user.heliohost.org/testings it works but when I visit using testings.user.heliohost.org it throws internal server error. Edited March 30, 2018 by Krydos removed key
Krydos Posted March 30, 2018 Posted March 30, 2018 # edit your username below sys.path.append("/home/username/public_html/flask"); Did you change that line to match your username?
patents Posted March 31, 2018 Author Posted March 31, 2018 (edited) Thanks. Sorry for not making it clear. I posted above sample from working example your provided in the original flask discussion which was working fine for me when I hosted at public_html/flask (by off course changing username). however when I created it as subdomain it was not working. The reason I presume could be this line. RewriteRule ^(.*)$ flask/flask.wsgi/$1 [QSA,PT,L]Because, when I was visiting flask.patents.heliohost.org it was giving me error but when I visited patents.heliohost.org/flask it was working fine. I am not Apache guy. you can throw some light. when I changed it to this: RewriteRule ^(.*)$ flask.wsgi/$1 [QSA,PT,L]Now patents.heliohost.org/flask is not working but flask.patents.heliohost.org is working. Thanks Edited March 31, 2018 by patents
Krydos Posted March 31, 2018 Posted March 31, 2018 One or the other is going to work when you change that line. You just need to pick.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now