No project description provided
Project description
Bottle Login – Implement users’ sessions in Bottle web framework.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bottle-login-0.0.2.tar.gz.
File metadata
- Download URL: bottle-login-0.0.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4025166cca2f363ff82bf95cddb8397381472dc8e87c7a771ab7aa2affe242e
|
|
| MD5 |
bfb9e4a31c2b75c8277b71bac7999689
|
|
| BLAKE2b-256 |
07f95cf883de74cbc1661eb8cdb8e08cd127c58bcb97ade5112218a0379ab047
|
File details
Details for the file bottle_login-0.0.2-py2.py3-none-any.whl.
File metadata
- Download URL: bottle_login-0.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df44fcc324812fe5b709d482a332316d35515860b5f10f79a7513698bc432fc5
|
|
| MD5 |
615416415d5ea4a9f8eb9971cff89543
|
|
| BLAKE2b-256 |
fd425f1fd1d28cf467217e276229d065ad62b040219b82fd185b23dcf6008f2a
|