I have a flask website set up with mod_wsgi and SQLAlchemy. My application db works perfectly on my local machine. On the remote server, I am able to read the db successfully only when I access it from the shell through the SQLAlchemy API. My mod_wsgi app is not reading the database correctly, though. This is on the remote server python shell:
Here is the (simplified) chunk of code in my flask views.py file that is functioning locally, but not on the remote server (notice that the SQL query is exactly the same as the one executed on the remote python shell):
Locally, accessing the URL that maps to this view shows the HTML
On my remote server, the HTML
shows up, even though that same expression is not None when queried through the remote python shell. This leads me to believe that the WSGI server that is running my flask app is not reading the SQLAlchemy db correctly. A few observations I've made/relevant information:
I would greatly appreciate any help here. Thank you! asked 07 May '15, 06:56 lnaran |
After checking the support ticket that you submitted concurrently with this question, it looks like this may have been a simple matter of code not being reloaded. Restarting your mod_wsgi Apache instance seems to have resolved it. answered 07 May '15, 17:29 seanf |