The object is not properly imported into a bottle structure


I'm trying to learn Flask from Instant Flask Web Development book following it step-by-step but I get the error presented below. (It seems to be a problem with circular imports.) The questions are:

Can someone explain what would be the fix and detail the circular imports?

Directory structure:

├── requirements.txt
└── sched
    ├── __init__.pyc
    ├── app.pyc
    ├── static
    └── templates

from flask.ext.script import Manager
from sched import app

manager = Manager(app)
app.config['DEBUG'] = True

if __name__ == '__main__':

from flask import Flask
app = Flask(__name__)

def hello_world():
    return 'Hello World!'

if __name__ == '__main__': is ampty.

Command line generated error:

$ python runserver
Traceback (most recent call last):
  File "", line 8, in <module>
    app.config['DEBUG'] = True
AttributeError: 'module' object has no attribute 'config'

When you do

from sched import app

you are importing the app module. The app object is inside the module. The import you want to use is

from import app