No project description provided
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
File details
Details for the file muffin-session-0.0.3.tar.gz
.
File metadata
- Download URL: muffin-session-0.0.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b0b7468789bd88275335ecc94b23059f47297d041ead3a461a84702001e561e |
|
MD5 | f6d31fee9e1cdd66bba98a3a976a5dae |
|
BLAKE2b-256 | e782e5c816e5847d8704b153db791f2f5ff0ff337255889f7ecbc801e8865e8d |
File details
Details for the file muffin_session-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: muffin_session-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54e3d73834e9c37d986d96b7497dd11871291cbb5d9afb14b27fd76af5bc0b6d |
|
MD5 | aa03dd10acb4fb36278dc402ee66d405 |
|
BLAKE2b-256 | 77907ca929cd7b674ad4f0ffc3bf5312b46dfa9e7a99a1efbe4feecf007a2948 |