Questions tagged [django-imagekit]

Automated image processing for Django models.

ImageKit is a Django app that helps you to add variations of uploaded images to your models. These variations are called “specs” and can include things like different sizes (e.g. thumbnails) and black and white versions.

Documentation is available at https://django-imagekit.readthedocs.io/

140 questions
0
votes
1 answer

Trouble serving uploaded images on Django

After a user has uploaded an image, she's always returns a 404 error. I think this is a Nginx missconfig but I'm not sure of it and after hours of search and tries I still don't understand the issue. Here's my settings.py : DEBUG = False STATIC_URL…
Arthur C-G
  • 1,481
  • 4
  • 16
  • 23
0
votes
1 answer

django / ImageKit - showing absolute path to images

I'm using the ImageKit and for some reason it's displaying the absolute path to images. Any idea how to make it to display the path I have set in the MEDIA_URL ?
avatar
  • 12,087
  • 17
  • 66
  • 82
0
votes
1 answer

How to save the generated image from Django ImageKit to ImageField?

I generate the image using the code below: source_file = open('/path/to/myimage.jpg', 'rb') image_generator = Thumbnail(source=source_file) result = image_generator.generate() What is the proper method to save the generated "result" back to django…
rajkris
  • 1,775
  • 1
  • 9
  • 16
0
votes
2 answers

Testing an ImageField in DRF

I am using Django Imagekit in models.py: from imagekit.models import ProcessedImageField class AltroUser(models.Model): first_name = models.CharField(_('first name'), max_length=30) image =…
toothie
  • 1,019
  • 4
  • 20
  • 47
0
votes
1 answer

(Django) How to transfer value from field to the custom ImageKit processor inside the model?

I use Django ImageKit to process/crop uploaded photos. I added my own custom processor to add text to the photo (like watermark): # ./example/processors.py from django.conf import settings from PIL import Image, ImageDraw, ImageFont _default_font…
koddr
  • 764
  • 2
  • 9
  • 27
0
votes
0 answers

Django CreateAPIView not saving image portion of django model

I am trying to make a django rest api which allows admin users to add images which the api clients can sync and display. My view responsible for creating the Clothing model, which holds a title and an image, is not working as it only saves the title…
0
votes
0 answers

Django MEDIA_ROOT Development in Windows Environment

In my settings.py ive added the following print(BASE_DIR) print(MEDIA_URL) print(MEDIA_ROOT) It prints the following d:/OneDrive/!code_projects/!django_projects/mgTut /media/ d:/OneDrive/!code_projects/!django_projects/mgTut/media/ But when I…
addohm
  • 2,248
  • 3
  • 14
  • 40
0
votes
2 answers

Django thumbnails suggestion

Looking for an alternate to django-imagekit. django-imagekit with django-cumulus causes loads of timeout issues and makes apps very inconsistent. Are there any alternatives that you can suggest that you have used in your previous projects?
ApPeL
  • 4,801
  • 9
  • 47
  • 84
0
votes
1 answer

Python package recognized in Pycharm, not in terminal

I'm developing a Django project which imports django-imagekit; everything works fine on my Windows machine. On my Linux-Ubuntu laptop though, Pycharm recognizes the package in the editor, it's listed in the project's interpreter's packages but it's…
Simon TheChain
  • 277
  • 1
  • 16
0
votes
0 answers

how to use django imagekit or django-photologue with generated images

I have a django model that I can use to dynamically load/generate images from non standard formats into numpy arrays which I convert to a PIL image and I can display. class Thing(models.Model): def gethttpimage(self): img = .... …
jmerkow
  • 1,811
  • 3
  • 20
  • 35
0
votes
1 answer

dynamically add fields to model (or store some fields in a separate class)

I want to use ImageSpecField of django-imagekit for resizing image, so I don't want to create a new ImageSpecField field for every ImageField in my models, I want to create a new class or modelField which contains original image and image thumbnail…
kianoosh
  • 610
  • 6
  • 22
0
votes
1 answer

django avatar custom template tag

My site is quite visual and I would like to make use of users avatars all over the site so I think that writing a custom template tag is the best way to go. My UserProfile is associated with a User and has an profile_pic. I am making use of…
ApPeL
  • 4,801
  • 9
  • 47
  • 84
0
votes
1 answer

Error deploying Django with ImageKit using Apache "cannot import name conf"

I'm trying to deploy my Django site with Apache but I'm running into issues with the ImageKit library. Here's the error from /var/log/apache2/error.log: No handlers could be found for logger "django.request" [1.2.3.4] mod_wsgi (pid=17276): Exception…
shoffing
  • 107
  • 1
  • 6
0
votes
2 answers

Django ImageKit and PIL

I am using django image and creating a custom processor. I want to find out the size in KB (or bytes) but unable to do so. The size attribute give the dimensions and not the size of the file. I am a newbie so have only been able to find attr of PIL…
Uma
  • 689
  • 2
  • 12
  • 35
0
votes
0 answers

django imagekit - compress and resize on condition

I am new to django. I am struggling to write the code for django imagekit which checks if the image is of a certain size and of certain dimension then compress or resize or do both at the same time. I have read about processors and defining…
Uma
  • 689
  • 2
  • 12
  • 35