title: ImportError: cannot import name
body: <p>I have two files <code>app.py</code> and <code>mod_login.py</code></p>
  
  <p>app.py</p>
  
  <pre><code>from flask import Flask
  from mod_login import mod_login
  
  app = Flask(__name__)
  app.config.update(
      USERNAME='admin',
      PASSWORD='default'
  )
  </code></pre>
  
  <p>mod_login.py</p>
  
  <pre><code># coding: utf8
  
  from flask import Blueprint, render_template, redirect, session, url_for, request
  from functools import wraps
  from app import app
  
  mod_login = Blueprint('mod_login', __name__, template_folder='templates')
  </code></pre>
  
  <p>And python return this error: </p>
  
  <pre><code>Traceback (most recent call last):
    File "app.py", line 2, in &lt;module&gt;
      from mod_login import mod_login
    File "mod_login.py", line 5, in &lt;module&gt;
      from app import app
    File "app.py", line 2, in &lt;module&gt;
      from mod_login import mod_login
  ImportError: cannot import name mod_login
  </code></pre>
  
  <p>If I delete <code>from app import app</code>, code will be work, but how I can get access to <code>app.config</code>?</p>