patents Posted March 30, 2018 Share 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 Quote Link to comment Share on other sites More sharing options...
Krydos Posted March 30, 2018 Share 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? Quote Link to comment Share on other sites More sharing options...
patents Posted March 31, 2018 Author Share 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 Quote Link to comment Share on other sites More sharing options...
Krydos Posted March 31, 2018 Share Posted March 31, 2018 One or the other is going to work when you change that line. You just need to pick. Quote Link to comment Share on other sites More sharing options...
patents Posted April 1, 2018 Author Share Posted April 1, 2018 Thats fine with me. Thanks. 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.