title: Flask - Setting root directory
body: <p>I have a folder structure that looks like so:</p>
  
  <pre><code>myproject/
      - flask_app/
          - app.py
          - templates/
      - module1.py
      - module2/
          - db.py
          - models/
  </code></pre>
  
  <p>I'm running into ImportErrors in my Flask application when trying to do the following:</p>
  
  <pre><code>from module2 import db
  # or something else like
  import module1
  
  from flask import Flask
  app = Flask(__name__)
  
  if __name__ == "__main__":
      app.run(debug=True)
  </code></pre>
  
  <p>This is obviously because the Flask app is running from its own subdirectory "flask_app". I normally would try and get around this by running it like so:</p>
  
  <pre><code>python -m flask_app.app
  </code></pre>
  
  <p>But this doesn't seem to solve the problem.</p>
  
  <p>Is there a way I run my flask app from the root folder without resorting to relative imports (using older version of Python)</p>