我是flask的新手,我正在尝试使用flask-login来管理我的应用程序中的用户身份验证以及Google plus登录。我在我的应用程序中使用flask.ext.login,但它显示了我
ImportError:没有名为 flask.ext.login 的模块
这是我的views.py文件
from google.appengine.api import users
from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError
from flask import request, render_template, flash, url_for, redirect
from flask.ext.login import current_user
import flask,flask.views
from flask_cache import Cache
from application import app
from decorators import login_required, admin_required
from forms import ExampleForm
from models import ExampleModel
class View(flask.views.MethodView):
def get(self):
# check if the user is logged in or not
if not login.current_user.is_authenticated():
return app.login_manager.unauthorized()
return flask.render_template('index.html')
class Login(flask.views.MethodView):
def get(self):
return None
def post(self):
# Create a state token to prevent request forgery.
# Store it in the session for later validation.
state = ''.join(random.choice(string.ascii_uppercase + string.digits)
for x in xrange(32))
session['state'] = state
# Set the Client ID, Token State, and Application Name in the HTML while
# serving it.
response = make_response(render_template('index.html',CLIENT_ID='1075048200759- 5hunu03e087bha87d48874veh1rvr97f.apps.googleusercontent.com', STATE=state, APPLICATION_NAME='uscore_signin'))
response.headers['Content-Type']='text/html'
return response, session
您能否建议我如何修复它,即使我遵循了之前的讨论,我是否以错误的方式使用了导入层次结构 烧瓶和 Flask-Login 的新功能-ImportError: No module named login