- Author:
jianglin
1 flask-avatar
1.1 Example
1.2 Installation
To install Flask-Avatar:
pip install flask-avatar
Or alternatively, you can download the repository and install manually by doing:
git clone git@github.com:honmaple/flask-avatar.git
cd flask-avatar
python setup.py install
1.3 Usage
from flask_avatar import Avatar
[...]
Avatar(app)
# or use cachefunc
Avatar(app, cache=cachefunc)
cachefunc must be a decorator: example:
def cachefunc(func):
@wrap(func)
def _cache(*args, **kwargs):
r = cacheclient.get("cache key")
if r is not None:
return r
return func(*args, **kwargs)
return _cache
Templates:
{{ url_for('avatar',text = user.username )}}
or set width with:
{{ url_for('avatar',text = user.username,width=60)}}
1.4 Config
AVATAR_URL = '/avatar' #The avatar url,default '/avatar/<text>/<width>'
AVATAR_RANGE = [0,512] #set avatar range to allow generate,if disallow,abort(404).Default [0,512]
1.5 Thanks to
Metadata
Release files for Flask-Avatar 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Flask-Avatar-0.1.3.tar.gz | 2.3 MB | Without provenance | Details for Flask-Avatar-0.1.3.tar.gz |
Release files / Flask-Avatar-0.1.3.tar.gz
| Download URL | Flask-Avatar-0.1.3.tar.gz |
|---|---|
| Size | 2.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
663bffd979337253d3c99bbf5889f659174361bb92f9257709fd2ae3de14446b
|
|
BLAKE2b-256 checksum How to use checksums |
f8cee45c6181111dd875f2ee8a14aad6c68077bb1c17bb1152b647e88e33f94f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Flask-Avatar 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.