title: how to run a flask app on apache2 (digital ocean)
body: <p>I am trying to run my flask application on a digital ocean server with apache2. I follow this tutorial </p>
  
  <p><a href="https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps" rel="nofollow">https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps</a></p>
  
  <p>following this tutorial works fine for me. However, I was wondering how to get an app running if the run.app() command is given in run.py instead of <strong>init</strong>.py? So how do I have to change </p>
  
  <pre><code>/etc/apache2/sites-available/FlaskApp.conf
  </code></pre>
  
  <p>and </p>
  
  <pre><code>/var/www/FlaskApp/flaskapp.wsgi 
  </code></pre>
  
  <p>The setup in the tutorial always seems to look for </p>
  
  <pre><code>/var/www/FlaskApp/FlaskApp/__init__.py
  </code></pre>
  
  <p>My run.py looks like this </p>
  
  <pre><code>#!/opt/local/bin/python
  from flask import Flask
  from app import app
  #app.run(debug = True)
  if __name__ == "__main__":
      app.run(debug=True, host='127.0.0.1', port=5000) 
  </code></pre>
  
  <p>thanks carl</p>