from flask import Flask
from flask_sslify import SSLify
from feverdream.views import views
from feverdream.wordpress import wordpress
from feverdream.blogger import blogger
from feverdream.tumblr import tumblr
from feverdream.micropub import micropub
from feverdream import extensions
import logging
from feverdream.models import *


def create_app(config_path):
    app = Flask(__name__)
    app.config.from_pyfile(config_path)

    if not app.debug:
        app.logger.setLevel(logging.DEBUG)
        stream_handler = StreamHandler()
        formatter = logging.Formatter(
            '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        stream_handler.setFormatter(formatter)
        app.logger.addHandler(stream_handler)

    # redirect all requests to https on Heroku
    if 'DYNO' in os.environ:
        SSLify(app)
    extensions.init_app(app)
    app.register_blueprint(views)
    app.register_blueprint(wordpress)
    app.register_blueprint(blogger)
    app.register_blueprint(tumblr)
    app.register_blueprint(micropub)
    return app

@@ -282,23 +282,8 @@
 ons%0A
-import logging%0A
 from
@@ -310,16 +310,41 @@
 mport *%0A
+import logging%0Aimport os%0A
 %0A%0Adef cr
@@ -523,16 +523,24 @@
 ndler = 
+logging.
 StreamHa

fix some imports in app.py