Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(211)  |  Call(111)  |  Derive(0)  |  Import(100)
Logs a user out. (You do not need to pass the actual user.) This will
also clean up the remember me cookie if it exists.

        def logout_user():
    '''
    Logs a user out. (You do not need to pass the actual user.) This will
    also clean up the remember me cookie if it exists.
    '''
    if 'user_id' in session:
        session.pop('user_id')

    if '_fresh' in session:
        session.pop('_fresh')

    cookie_name = current_app.config.get('REMEMBER_COOKIE_NAME', COOKIE_NAME)
    if cookie_name in request.cookies:
        session['remember'] = 'clear'

    user = _get_user()
    if user and not user.is_anonymous():
        user_logged_out.send(current_app._get_current_object(), user=user)

    current_app.login_manager.reload_user()
    return True
        


src/f/l/Flask-Simon-0.3.0/examples/flask-login/login.py   Flask-Simon(Download)
from flask import Flask, redirect, render_template, request, url_for
from flask.ext.login import (AnonymousUser, LoginManager, UserMixin,
                             login_required, login_user, logout_user)
from flask.ext.simon import Simon, Model
 
def logout():
    """Logs out the user, redirects to the home page"""
 
    logout_user()
    return redirect(url_for('.index'))

src/d/d/ddd-flask-example-HEAD/blogex/service/authentication_service.py   ddd-flask-example(Download)
from flask.ext.login import LoginManager
from flask.ext.login import login_user as god_login, logout_user as god_logout
from flask.ext.login import login_required as flask_login_required
import flask.ext.login
 
    def logout_current_user(self):
        god_logout()
 
    def get_current_user(self):
        return self.user_repository.get_by_username(flask.ext.login.current_user.username)

src/f/l/Flask-Oauth2-Example-HEAD/app.py   Flask-Oauth2-Example(Download)
from flask import (Flask, redirect, url_for, session, render_template,
                   request, make_response)
from flask.ext.login import (LoginManager, login_user, logout_user, login_required,
                             current_user)
from flask.ext.oauth import OAuth
def logout():
    logout_user()
    return redirect(url_for('index'))
 
@app.route(app.config['REDIRECT_URI'])

src/f/l/flask-admin-HEAD/examples/menu-external-links/simple.py   flask-admin(Download)
def logout_view():
    login.logout_user()
    return redirect(url_for('admin.index'))
 
 

src/p/y/python-social-auth-HEAD/examples/flask_me_example/routes/main.py   python-social-auth(Download)
from flask import render_template, redirect
from flask.ext.login import login_required, logout_user
 
from flask_me_example import app
 
def logout():
    """Logout view"""
    logout_user()
    return redirect('/')
 

src/p/y/python-social-auth-HEAD/examples/flask_example/routes/main.py   python-social-auth(Download)
from flask import render_template, redirect
from flask.ext.login import login_required, logout_user
 
from flask_example import app
 
def logout():
    """Logout view"""
    logout_user()
    return redirect('/')
 

src/f/l/flask-admin-HEAD/examples/auth/auth.py   flask-admin(Download)
    def logout_view(self):
        login.logout_user()
        return redirect(url_for('.index'))
 
 

src/f/l/flask-admin-HEAD/examples/auth-mongoengine/auth.py   flask-admin(Download)
def logout_view():
    login.logout_user()
    return redirect(url_for('index'))
 
if __name__ == '__main__':

src/f/l/Flask-SuperAdmin-HEAD/examples/auth/mongoauth.py   Flask-SuperAdmin(Download)
def logout_view():
    login.logout_user()
    return redirect(url_for('index'))
 
if __name__ == '__main__':

src/f/l/Flask-SuperAdmin-HEAD/examples/auth/auth.py   Flask-SuperAdmin(Download)
def logout_view():
    login.logout_user()
    return redirect(url_for('index'))
 
if __name__ == '__main__':

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next