View on GitHub

neo4j-flask

A microblog application powered by Flask and Neo4j.

Download this project as a .zip file Download this project as a tar.gz file

Logout a User

When all the fun is over, a user logs out by clicking the logout link at the top of the page, which sends a GET request to the /logout view:

@app.route('/logout', methods=['GET'])
def logout():
    session.pop('username', None)
    flash('Logged out.')
    return redirect(url_for('index'))

This removes username from the session object and takes the visitor back to the home page.

Next: Add Style