Skip to main content

UNKNOWN

Project description

Bottle Login – Implement users’ sessions in Bottle web framework.

Build Status Coverals http://img.shields.io/pypi/v/bottle-login.svg?style=flat-square http://img.shields.io/pypi/dm/bottle-login.svg?style=flat-square Donate

Requirements

  • python >= 2.6

Installation

Bottle Login should be installed using pip:

pip install bottle-login

Usage

from bottle import Bottle, request, redirect
from bottle_login import LoginPlugin

app = Bottle()
app.config['SECRET_KEY'] = 'secret'

login = app.install(LoginPlugin())

@login.load_user
def load_user_by_id(user_id):
    # Load user by id here


# Some application views

@app.route('/')
def index():
    current_user = login.get_user()
    return current_user.name

@app.route('/signout')
def signout():
    # Implement logout
    login.logout_user()
    return redirect('/')

@app.route('/signin')
def signin():
    # Implement login (you can check passwords here or etc)
    user_id = int(request.GET.get('user_id'))
    login.login_user(user_id)
    return redirect('/')

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/bottle-login/issues

Contributing

Development of Bottle Login happens at: https://github.com/klen/bottle-login

Contributors

  • klen (Kirill Klenov)

License

Licensed under a BSD license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bottle-login-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

bottle_login-0.0.1-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file bottle-login-0.0.1.tar.gz.

File metadata

File hashes

Hashes for bottle-login-0.0.1.tar.gz
Algorithm Hash digest
SHA256 51e0873e8e7dfcbe74d62b742f7414200694f58d9357f08697db8b3542195414
MD5 733491235111311f2099c083f0defdc6
BLAKE2b-256 cc0cbdf81d17044c9e0afc64dd1192e974e6fd9315973569ae523e670f949e9e

See more details on using hashes here.

File details

Details for the file bottle_login-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for bottle_login-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1a57fa69939074c986d89c6681433ce91f844bfa845accb9b19a34f8dd273398
MD5 be3338e1bb55366222645ade5b5ed9fb
BLAKE2b-256 b1daefa2a1b03c674c327243679d08091a15de48b43b0ce9fd68efd81ad248e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page