from flask import Flask
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config.from_object('config')
login_manager = LoginManager()
login_manager.init_app(app)
db = SQLAlchemy(app)

from app import views, models
from werkzeug.contrib.fixers import ProxyFix
from flask import Flask
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config.from_object('config')
app.wsgi_app = ProxyFix(app.wsgi_app)

login_manager = LoginManager()
login_manager.init_app(app)
db = SQLAlchemy(app)

from app import views, models

Add ProxyFix() middleware component to fix the HTTPS redirection issue. See !17
Add ProxyFix() middleware component to fix the HTTPS redirection issue. See !17

+ from werkzeug.contrib.fixers import ProxyFix
  from flask import Flask
  from flask.ext.login import LoginManager
  from flask.ext.sqlalchemy import SQLAlchemy
  
  app = Flask(__name__)
  app.config.from_object('config')
+ app.wsgi_app = ProxyFix(app.wsgi_app)
+ 
  login_manager = LoginManager()
  login_manager.init_app(app)
  db = SQLAlchemy(app)
  
  from app import views, models
+ 
Add ProxyFix() middleware component to fix the HTTPS redirection issue. See !17
## Code Before:
from flask import Flask
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config.from_object('config')
login_manager = LoginManager()
login_manager.init_app(app)
db = SQLAlchemy(app)

from app import views, models
## Instruction:
Add ProxyFix() middleware component to fix the HTTPS redirection issue. See !17
## Code After:
from werkzeug.contrib.fixers import ProxyFix
from flask import Flask
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config.from_object('config')
app.wsgi_app = ProxyFix(app.wsgi_app)

login_manager = LoginManager()
login_manager.init_app(app)
db = SQLAlchemy(app)

from app import views, models
