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.1.tar.gz
(87.3 kB
view details)
File details
Details for the file django-simplecrop-1.0.1.tar.gz
.
File metadata
- Download URL: django-simplecrop-1.0.1.tar.gz
- Upload date:
- Size: 87.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8be354125bdc4a28227d59fb46ffab81d714ff73a23b0d60f2c1231c40319a00 |
|
MD5 | 297776931a235227fe85fdb85e53a0db |
|
BLAKE2b-256 | 6e9960ea49005403951b38103c76303437b957b815fc8f7739dd260a7a76e299 |