Jump to content

Flask app on subdomain.


Recommended Posts

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 by Krydos
removed key
Link to comment
Share on other sites

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 by patents
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.

 Share

×
×
  • Create New...