![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
django-awesome-avatar
Advanced tools
Django-awesome-avatar is a reusable application providing Avatar model field. It allows crop selected area before saving image.
| Unlike django-avatar_ and django-upload-avatar_
| django-awesome-avatar_ uses:
To integrate django-awesome-avatar
with your site, there are few things
that are required:
#. Installing::
pip install django-awesome-avatar
#. List this application in the INSTALLED_APPS
portion of your settings file.
Your settings file will look something like::
INSTALLED_APPS = (
...
'awesome_avatar',
)
Add the AvatarField
to your user or profile model::
from awesome_avatar.fields import AvatarField
class Profile(Model):
user = OneToOneField(User, related_name='profile')
...
avatar = AvatarField(upload_to='avatars', width=100, height=100)
Use model form usually way::
class AvatarChangeForm(ModelForm):
class Meta:
model = Profile
fields = ['avatar']
def change_avatar(request):
if request.method == 'POST':
form = AvatarChangeForm(request.POST, request.FILES,
instance=request.user.profile)
if form.is_valid():
form.save()
return HttpResponseRedirect('/profile/')
else:
form = AvatarChangeForm(instance=request.user.profile)
return render(request, 'template.html', {'form': form})
Define some model for saving images::
class Images(Model):
image = ImageField(upload_to='images')
Use form field for cropping image::
from awesome_avatar import forms as avatar_forms
class UploadAndCropImageForm(Form):
image = avatar_forms.AvatarField()
def upload_and_crop_image(request):
if request.method == 'POST':
form = UploadAndCropImageForm(request.POST)
if form.is_valid():
Images(image=form.image).save()
return HttpResponseRedirect('/any/')
else:
form = UploadAndCropImageForm()
return render(request, 'template.html', {'form': form})
Django's settings.py
::
AWESOME_AVATAR = {
'width': 100,
'height': 100,
'select_area_width': 400,
'select_area_height': 300,
'save_quality': 90,
'save_format': 'png',
...
}
.. _django-avatar: https://github.com/jezdez/django-avatar .. _django-upload-avatar: https://github.com/yueyoum/django-upload-avatar .. _django-awesome-avatar: https://github.com/dimka665/django-awesome-avatar
FAQs
Django Avatar field
We found that django-awesome-avatar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.