Placeholder image on the fly for Turbogears2
Project description
About placeholder
tgapp-placeholder is a Pluggable application for TurboGears2 that allows placeholder images generation on the fly. Inspired by http://dummyimage.com/ and https://github.com/darkrho/django-dummyimage.
Installing
placeholder can be installed both from pypi or from github:
pip install tgapp-placeholder
should just work for most of the users
Plugging placeholder
In your application config/app_cfg.py import plug:
from tgext.pluggable import plug
Then at the end of the file call plug with placeholder:
plug(base_config, 'placeholder')
You will be able to access the plugged application at http://localhost:8080/placeholder.
Using placeholder
You are now able to get your fake images by calling:
http://you-application/placeholder/{width} #for a square image http://you-application/placeholder/{width}x{height} http://you-application/placeholder/{width}x{height}?text={some text value}
- actually the parameters you can play are:
text : a custom online text wich size is calculated to fit your image width
bgcolor : the background color in HEX rgb form (default set to ‘DDDDDD’)
color : the text color in HEX rgb form (default set to ‘888888’)
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
File details
Details for the file tgapp-placeholder-0.9.tar.gz
.
File metadata
- Download URL: tgapp-placeholder-0.9.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f59075d748bb431d380dd5d93409eb5c66b8b5c34eba02213068e28d22414ca6 |
|
MD5 | cd4f87f56d0f9140d700db8b83b6ece6 |
|
BLAKE2b-256 | 74dd56ed6d4679ea3fcbe994defc67b8a6a1217ab11ccbe8827bb860e4c64a23 |