UNKNOWN
Project description
Muffin-Session – Implement an user sessions in Muffin Framework.
Requirements
python >= 3.3
Installation
Muffin-Session should be installed using pip:
pip install muffin-session
Usage
Add muffin_peewee to PLUGINS in your Muffin Application configuration.
Options
SESSION_DEFAULT_USER_CHECKER – A function which checks logged user (lambda x: x) SESSION_LOGIN_URL – Redirect URL (‘/login’) SESSION_SECRET – A secret code (‘Insecuresecret’)
Views
@app.ps.session.user_loader def load_user(_id): """Define your own user loader. """ @app.register('/admin') @app.ps.session.user_pass(lambda u: u.is_admin) def admin(request): """ Check for user is admin. """ @app.register('/login') def login(request): """ Login user. """ # ... yield from app.ps.session.login(curuser.pk) @app.register('/logout') """ Logout user. """ # ... yield from app.ps.session.logout(curuser.pk)
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin-session/issues
Contributing
Development of Muffin-Session happens at: https://github.com/klen/muffin-session
Contributors
klen (Kirill Klenov)
License
Licensed under a MIT 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
Hashes for muffin_session-0.0.1-cp34-cp34m-macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65e148b687e4e854b0ac32964380fa64370fdcd698f22182f93a434b818928c5 |
|
MD5 | dd0cd1587ef259897f13c4732ccf6eca |
|
BLAKE2b-256 | cbbba65643bffb7567f5469e4dde292753509a371802650b93427ad75d40caba |