Get 404 Not Found when running Flask app
<p>I want to setup Flask on Apache. I tested my Apache configuration successfully, but I cannot run it with the following Flask application. Therefore I didn't post this question to server fault but to Stack Overflow.</p>

<p>Calling <code>http://54.68.62.180</code> throws the following error:</p>

<blockquote>
  <p>Not Found</p>
  
  <p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>
</blockquote>

<p>For the records, my Apache configuration <strong>AppName.conf</strong> file looks like this:</p>

<pre><code>&lt;VirtualHost *:80&gt;
               ServerName 54.68.62.180
               WSGIDaemonProcess AppName threads=5
               WSGIScriptAlias / /var/www/AppName/appname.wsgi
               &lt;Directory /var/www/AppName&gt;
                       WSGIProcessGroup AppName
                       WSGIApplicationGroup %{GLOBAL}
                       Order allow,deny
                       Allow from all
               &lt;/Directory&gt;
               ErrorLog ${APACHE_LOG_DIR}/error.log
               LogLevel info
               CustomLog ${APACHE_LOG_DIR}/access.log combined
&lt;/VirtualHost&gt;
</code></pre>

<p>My <strong>appname.wsgi</strong> looks like this:</p>

<pre><code>#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/AppName")

from appname import application
application.secret_key = 'my_key'
</code></pre>

<p>In my Flask application, the <strong>application.py</strong> file looks like this:</p>

<pre><code>from appname import application
from appname.socket_interface import socketio

if __name__ == '__main__':
    socketio.run(application)
    #application.run()
</code></pre>

<p>I tried both, socketio.run(application) and application.run(), in both cases I get the error. Some other posts like <a href="https://stackoverflow.com/questions/25383187/flask-tutorial-404-not-found">Flask tutorial - 404 Not Found</a> seem to hint that the app is "executed before any of your routes are registered" but my application.run() is already at the bottom of the file.</p>

<p>The routing is specified in appname/appname/<strong>init</strong>.py through:</p>

<pre><code>application.register_blueprint(frontend, url_prefix='/app')
</code></pre>

<p>and in </p>

<pre><code>appname/appname/frontend/__init__.py
</code></pre>

<p>the html source is routed through:</p>

<pre><code>@frontend.route('/')
def frontend_test():
    return frontend.send_static_file('index.html')
</code></pre>

<p>What am I doing wrong here and why do I get the 404 error?</p>