Note that there are some explanatory texts on larger screens.

plurals
  1. PODeploying a flask application with mod_wsgi
    primarykey
    data
    text
    <p>I'm trying to deploy one of my Flask apps to mod_wsgi on apache, but I'm having trouble because apache tries to solve SOME of the routes on the filesystem:</p> <p><strong>apache's error_log:</strong></p> <pre><code>[Mon Aug 06 19:18:38 2012] [error] [client ::1] File does not exist: /srv/http/webchat/src/_publish_message, referer: http://localhost:88/webchat/chat </code></pre> <p>I'm saying "SOME of the routes" because the authentication (on "/") and redirection to "/chat" works. </p> <p>The route "_publish_message" is accessed via AJAX like this (using jQuery):</p> <pre><code>function publish_message(e){ e.preventDefault(); $.post('/_publish_message', {'message': "user's message taken from a text field"}) .fail(Handler.publish_error); } </code></pre> <p>The route "_sse_stream" is used as the URL for an EventSource.</p> <p>These two aren't working!</p> <p>The virtual host configuration:</p> <pre><code>&lt;VirtualHost *:88&gt; ServerName webchat.dev WSGIDaemonProcess webchat user=http group=http threads=5 WSGIScriptAlias /webchat /srv/http/webchat/src/webchat.wsgi WSGIScriptReloading On DocumentRoot /srv/http/webchat/src &lt;Directory /srv/http/webchat/src&gt; WSGIProcessGroup webchat WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>The <code>webchat.wsgi</code> file:</p> <pre><code>import sys sys.path.insert(0, '/srv/http/webchat/src') from index import app as application </code></pre> <p>A basic "hello world" app deployed to <code>mod_wsgi</code> runs OK. My flask app, when run using the development server integrated into flask, behaves well.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload