title: ImportError: cannot import name 'app' from partially initialized module 'market' (most likely due to a circular import)-Flask
body: <pre><code>#market package
  from flask import Flask, render_template
  from flask_sqlalchemy import SQLAlchemy
  from market import routes
  app = Flask(__name__)
  app.config\['SQLALCHEMY_DATABASE_URI'\] = 'sqlite:///market.db'
  db = SQLAlchemy(app)
  ----------
  from market import db #(models)
  ----------
  from market import app #(routes)
  from flask import render_template
  from market.models import Item
  ----------#run
  from market import app
  if __name__ == '__main__':
  app.run(debug=True)
  </code></pre>
  <p>Structuring the code into packages then importing modules but  then getting the above error</p>