Default static path for Django ImageField
Project description
Default static file path for Django ImageField
Setup
install it via pip install django-default-image-field
add it to your settings and it auto-registers itself
settings.INSTALLED_APPS = [ ... 'django_fields', ... ]
Usage
add field to your model class
from django_fields import DefaultStaticImageField class Post(models.Model): photo = DefaultStaticImageField(blank=True)
default path is images/no_image.png, you can change it via settings.py
# settings.py DEFAULT_IMAGE_PATH = 'images/custom_none_image.png'
or add field attribute default_image_path
class Post(models.Model): photo = DefaultStaticImageField(blank=True, default_image_path='images/blank.png')
Contributing
As an open source project, we welcome contributions.
The code lives on github.
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
Close
Hashes for django-default-imagefield-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a82f2c66c7f66ecbbdeef66151d0479739475d2f607a1c71c3ee59abdc76707 |
|
MD5 | e9ed67e07117cb73f9d1801b2eb3c8db |
|
BLAKE2b-256 | 0621bb8bc758690cae6e055f9e550eb1f96f478bb32b555dc36d1ee4e99561bd |