aneesh2usman / django_cropper_image Goto Github PK
View Code? Open in Web Editor NEWdjango-cropper-image is an app for client side cropping and compressing uploaded images via Django's app using with help cropper.js
License: MIT License
django-cropper-image is an app for client side cropping and compressing uploaded images via Django's app using with help cropper.js
License: MIT License
@aneesh2usman could you add the compatible python and django versions in the readme?
That'd be quite helpful.
I would like to use the app to make profile photo upload easy. I have a default User model in Django (5.01) and there is a Profile model with one to one link to the user model. When a user registers, I create a Profile instance with th foreign key and leave the other blank. Here is the field definition:
from django_cropper_image.fields import ImageCropperField
class UserProfile(models.Model):
...
avatar = ImageCropperField(verbose_name="Profil fotó",
upload_to="photos/%Y/%m",
max_length=255,
blank=True,
null=True)
...
When I try to save my profile, where the avatar field is empty as all the others but the user, I got an exception:
AttributeError: 'NoneType' object has no attribute 'get'
The issue is within your fields.py file at row 184 in pre_save method, the following line:
self.b64data = self.cropperconstobj.get()
Obviously the self.cropperconstobj is None.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.