A simple module to make easier crop images in Django admin.
Project description
django-simplecrop
================
Simple module to make easier crop images in Django admin.
Installation
-----------------------------------
Install ``django-simplecrop`` (or download from [PyPI](http://pypi.python.org/pypi/django-simplecrop/ "Download from PyPI")):
pip install django-simplecrop
Add ``simplecrop`` to ``INSTALLED_APPS`` in ``settings.py``:
INSTALLED_APPS = (
...
'simplecrop',
...
)
Include ``simpleCropAutodiscover()`` after ``admin.autodiscover()``:
...
from simplecrop.utils import simpleCropAutodiscover
admin.autodiscover()
simpleCropAutodiscover()
Include ``simplecrop.urls`` in ``urls.py``:
urlpatterns = patterns('',
...
url(r'^simplecrop/', include('simplecrop.urls')),
)
Usage
------------------
Include the ``__crops__`` parameter in your model and specify the field and image sizes:
class MyModel(models.Model):
__crops__ = [
["image", ["110x110", "200x150"]]
]
title = models.CharField(u"Title", max_length=128)
text = models.TextField("Text")
image = models.ImageField("Image", upload_to="images")
Testing
-----------------
Step 1 - Add image:
![Step 1](http://feliperego.com/img/step1.png "Step 1")
Step 2 - Crop images:
![Step 2](http://feliperego.com/img/step2.png "Step 2")
Authors
-----------------
- [Felipe R. Rêgo](https://github.com/feliperrego "GitHub - Felipe R. Rêgo")
- [Silvio Lucena Junior](https://github.com/silviolucenajunior "GitHub - Silvio Lucena")
================
Simple module to make easier crop images in Django admin.
Installation
-----------------------------------
Install ``django-simplecrop`` (or download from [PyPI](http://pypi.python.org/pypi/django-simplecrop/ "Download from PyPI")):
pip install django-simplecrop
Add ``simplecrop`` to ``INSTALLED_APPS`` in ``settings.py``:
INSTALLED_APPS = (
...
'simplecrop',
...
)
Include ``simpleCropAutodiscover()`` after ``admin.autodiscover()``:
...
from simplecrop.utils import simpleCropAutodiscover
admin.autodiscover()
simpleCropAutodiscover()
Include ``simplecrop.urls`` in ``urls.py``:
urlpatterns = patterns('',
...
url(r'^simplecrop/', include('simplecrop.urls')),
)
Usage
------------------
Include the ``__crops__`` parameter in your model and specify the field and image sizes:
class MyModel(models.Model):
__crops__ = [
["image", ["110x110", "200x150"]]
]
title = models.CharField(u"Title", max_length=128)
text = models.TextField("Text")
image = models.ImageField("Image", upload_to="images")
Testing
-----------------
Step 1 - Add image:
![Step 1](http://feliperego.com/img/step1.png "Step 1")
Step 2 - Crop images:
![Step 2](http://feliperego.com/img/step2.png "Step 2")
Authors
-----------------
- [Felipe R. Rêgo](https://github.com/feliperrego "GitHub - Felipe R. Rêgo")
- [Silvio Lucena Junior](https://github.com/silviolucenajunior "GitHub - Silvio Lucena")
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
django-simplecrop-1.0.2.tar.gz
(88.0 kB
view details)
File details
Details for the file django-simplecrop-1.0.2.tar.gz
.
File metadata
- Download URL: django-simplecrop-1.0.2.tar.gz
- Upload date:
- Size: 88.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0ec6f5d76e7176ead78f1dbcaaf3372c6fca1daea50afa44ad318c7b94913ca |
|
MD5 | ab508f05f2ac9c59e0d58307b8e9e7e8 |
|
BLAKE2b-256 | b6906b54cc7bd834aad2338d4c157b1cab40ca3aa081054972366b972d984bcb |