title: Deploying flask application factory on apache
body: <p>I'm not having any luck getting this to work.</p>
  
  <p>my run.py file which works fine looks like this :</p>
  
  <pre><code>from dpc import create_app
  
  if __name__ == '__main__':
      app = create_app("config.py")
  
      app.run("0.0.0.0",debug=True,port=666,threaded=True)
  </code></pre>
  
  <p>my application factory in __init__.py looks like this:</p>
  
  <pre><code>def create_app(config_filename):
      app = CustomFlask(__name__)
      from dpc import mongo_models
      app.config.from_pyfile(config_filename)
      app.register_blueprint(retrieve, url_prefix="/retrieve")
      return app
  </code></pre>
  
  <p>and my wsgi file looks like this:</p>
  
  <pre><code>import sys
  import os
  
  sys.path.insert(0, 'C:/dpc')
  
  from dpc import create_app
  app = create_app("config.py")
  </code></pre>
  
  <p>my httpd.conf file has this:</p>
  
  <pre><code>&lt;VirtualHost *:666&gt;
      ServerName DPC
  
      WSGIScriptAlias / C:/dpc/dpc/dpc.wsgi
  
      &lt;Directory C:\dpc &gt;
          Options All
          AllowOverride None
          Require all granted
      &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I have a non application factory flask app running fine on Apache and have merrily for years, but this one gives me no errors and returns nothing.  I've been trying various changes and searching for a solution for the last few hours to no avail.  Any ideas?</p>