{"repo":"maxcountryman/flask-login","free":true,"listed":false,"github":"https://github.com/maxcountryman/flask-login","clone":"git clone https://github.com/maxcountryman/flask-login.git","description":"Flask user session management.","language":"Python","stars":3676,"topics":["authentication","login-system","session-management"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Flask-Login Flask-Login provides user session management for [Flask][]. It handles the common tasks of logging in, logging out, and remembering your users' sessions over extended periods of time. Flask-Login is not bound to any particular database system or permissions model. The only requirement is that your user objects implement a few methods, and that you provide a callback to the extension capable of loading users from their ID. Read the documentation at . [Flask]: https://flask.palletsprojects.com A Basic Example Let's walk through setting up a basic application. Note that this is a very basic guide: we will be taking shortcuts here that you should never take in a real application. To begin we'll set up a Flask app and a LoginManager from Flask-Login. To keep things simple we're going to use a basic User class and a dictionary to represent a database of users. In a real application, this would be an actual persistence layer. However, it's important to point out this is a feature of Flask-Login: it doesn't care how your data is stored so long as you tell it how to retrieve it! We also need to tell the login manager how to load a user from a request by defining its user loader callback. If no user is found it returns None . Now we're ready to define our views. The login view will populate the session with authentication info. The protected view will only be avialble to authenticated users; visiting it otherwise will show an error. The logout view clearing the session.","default_branch":null,"files":null,"tree":[],"storefront":"/r/maxcountryman","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/maxcountryman/flask-login/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}