Questions tagged [imagefield]

A place to store or display a graphic image.

"Image field" is a generic term that typically would belong in a or setting such as:

It appears to be a synonym for .

342 questions
1
vote
0 answers

Failure to access image from ImageField from model to display on one of my html pages

I am working on a commerce app wher a user can create a listing and also upload the image of the listing. The data is handled by a ModelForm: class ListingForm(ModelForm): class Meta: model = Listing exclude = [ …
1
vote
1 answer

Migrating from Client-Django-S3 image/file upload to Client-S3 Presigned URL upload, while maintaining FileField/ImageField?

The current state of our app is as follows: A client makes a POST request to our Django + DRF app server with one or more files, the django server processes the files, then uploads and saves it to S3. This is done using the amazing django-storages &…
1
vote
2 answers

Delete Django ImageField and FileField records whose files are not found on the server

I've recently lost some files in my media folder, and I want to delete the image field/FileField objects whose files have been removed, across all models of my application. I've tried django-cleanup, but it appears to be doing the inverse operation,…
wilcoln
  • 63
  • 1
  • 7
1
vote
1 answer

Django images not found in page view but was save after post request

I was trying to save an image but it can't be displayed through the browser. It was successfully saved in the exact location but when I pasted the link it says, "Page not found". Could someone help me with what's going on? See output: Browser…
1
vote
1 answer

django imageField returns False when I delete the image

I am using three imageFields in a form. It works well but when I use the (built-in) delete function("effacer") as shown is this image below and I save my form, I get "False" in my database... How can I remove totaly the path ("uploads/...") of the…
al78310
  • 83
  • 9
1
vote
1 answer

How to get the first image field from a node without knowing the field's name?

The site I am working on uses many content types and almost all of them use one or more image fields. Image fields are not shared between content types, so there is a big number of them. What I need is to get the first image field from a node,…
ovi
  • 431
  • 5
  • 11
1
vote
2 answers

How to save URL to a Django ImageField

I have Django model with Image field, but sometimes I don't need to actually upload file and store path to it, but I need to store only path. Especially url. I mean, I have web client, that receives both foreign urls like sun1-17.userapi.com and url…
roptok
  • 47
  • 6
1
vote
2 answers

How to add a class to img rendered by imagefield?

I am uploading an image with Imagefield and I want to add a class to because there is no class defined for images rendered by Imagefield. Is this possible in Drupal 6?
Himanshu
  • 11
  • 2
1
vote
0 answers

Django GraphQL Testing Images

I'm currently performing pytest to test my GraphQL mutations. In this case, I input a test image file to determine if it's working. The following is a sample test in which the SimpleUploadedFile object throws a not JSON serializable error. What…
1
vote
1 answer

Django removes "@" and other special character from file name

I want to upload a file with filename as email of the uploader. I know this is not a OS file system issue, nor a unsupported python operation because I did save images with this format in python. Now I want to save the images in model(Specifically…
1
vote
0 answers

upload image and already saved image, this two parts want to display on two different html template

I use modelformset_factory to upload image, but I want to separate the already saved image (A in the below link) and upload image (B in the below link) on two different html template. How do I resolve this problem? Here is my code…
ethon
  • 21
  • 2
1
vote
1 answer

Django media image displays blank box

Hi I'm trying to display an uploaded user image in django but when I try to display it only a blank box appears. However when I click on the image it brings up a new page with the image. I don't know why it isn't displaying on the page. html {% load…
callison98
  • 11
  • 1
1
vote
1 answer

How can I not put data in ImageField in Django?

I am to store images in imagefield. But I don't want to print out an error even if I don't put an image in ImageField. In other words, I want to leave ImageField null.I also tried null=True and blank=True to do this, but it didn't work properly.…
leedjango
  • 411
  • 2
  • 9
  • 18
1
vote
1 answer

Django: Image Field not showing up

So my image is not displaying, here is my code: models.py: from django.contrib.auth.models import User from django.db import models from django.conf import settings from django.utils.translation import gettext_lazy as _ class…
user13932636
1
vote
1 answer

Django: Use ImageField in Modelforms

So I have this model forms: User = get_user_model() class UserRegisterForm(forms.ModelForm): username = forms.CharField(label='', widget=forms.TextInput(attrs={'placeholder': 'Username'})) email = forms.EmailField(label='',…
user13932636