New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mod_wsgi to serve a python dash script on Apache2 #585
Comments
You have various things wrong in your Apache configuration. SO says you have:
The path for the It is also a bad idea to add your WSGI script file under For a start, you want to use:
The rest is irrelevant. If you move the WSGI script alias outside of Try those changes for a start. Also indicate what URL path you are using to access it. If the WSGI application is correct setup, you shouldn't need:
in which case the URL path you would use would be:
Right now it will probably only work if you use:
because you incorrectly have set |
Hi Graham, I have edited both
and
(I'm not sure how I ended up with both sites-available and sites-enabled. This error on my part may be part of the issue?) My script file:
And my *.wsgi file:
I am accessing this in a browser via my VM IP, i.e. I was trying As an aside:
|
It relies on:
Usually you wouldn't not include that though and would instead use:
option to Usually you would not set the Either way, your code shouldn't rely on accessing files via a relative directory, but calculate absolute paths, which is why should rely on As to why it just says loading, not sure. Open the browser developer console and see if there are error messages there, or in the network tab of browser developer console see what assets couldn't be downloaded for the page. |
G'day Graham, Thank you for solving the problems, Graham - much appreciated. Would you mind giving me a suggestion for how I should I set up my wsgi sites, if not having the *.wsgi inside the /var/www directory?
Thanks again. I really appreciate the prompt advice. |
The As to config, you could have skipped the
|
OK. So you configure the dash.conf file to point to the python script instead. I imagine this could lead to problems however if I have several python files in the I encountered another issue with wsgi not finding a file ( Thank you SO much for all your help. Please feel free to add an answer on SO and I'll accept it. (If you don't have enough time, I can answer my own question with all of the steps you suggested, etc.) |
Hi Graham
I'm trying to host a plotly-dash on an Apache2 using mod_wsgi. I've posted about this issue at StackOverflow.
Essentially, with what looks like the normal *.wsgi configuration:
I get a
404 not found
page (subtly different from the standard Apache 404 not found page). This leads me to believe there is something in the mod_wsgi configuration that hasn't worked.But if I edit the *.wsgi file to
from dashGAF import app as application
then I no longer get a 404, but I get a 500 Internal Server error. Apache log says:TypeError: 'Dash' object is not callable
.More info:
pip install mod_wsgi
(and withsudo ...
as well) and configured the mods-available file withmod_wsgi-express module-config
.Happy to paste any output or logs as requested. (and for it to be here or StackOverflow).
Cheers
Dave
I would appreciate any and all help in setting this up to work.
The text was updated successfully, but these errors were encountered: