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
0
votes
1 answer

How can my user upload an image to email to me [Django]

I've got a simple website for a Screenprinting company built using Django 1.10 and Python 3.5.2, but I am having issues with my "Get a Quote" page. The idea is a user can go to www.example.com/quote/ and they are presented with a form. Here they put…
0
votes
1 answer

Can't use ImageField in Django now. Any alternatives?

I have been working on a deep learning Django app that requires PIL installed. Now, I want to handle some images sent from an Android app. Imagefield seems to depend on Pillow. But both PIL and Pillow can't exist together. Can FileField be used for…
bittterbotter
  • 445
  • 6
  • 18
0
votes
2 answers

Django ImageField error : cannot open image file

I put the ImageField into the Model and can successfully upload the image file. But when try to open the file through admin page. Cannot open the file but there is an error says "500 Internal server error". In the file name there are some non-ascii…
nextdoordoc
  • 1,727
  • 6
  • 20
  • 30
0
votes
0 answers

Django: got error when using upload_to feature

I want to apply upload_to in my Django models.py from mongoengine import * from .settings import DBNAME from embed_video.fields import EmbedVideoField class Author(Document): fk_user = IntField() #points to user id in sqlite3. …
Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108
0
votes
1 answer

How I can access the fields without translation through an instance of TranslatableModel?

I need the name of the project (field project, no translation) for build the path of upload_to directory in ImageField. But i get this error: AttributeError at /admin/api/stage/add/ 'StageTranslation' object has no attribute 'project' def…
frannlu
  • 3
  • 4
0
votes
1 answer

Show an image from models in Django

I'm trying to figure out how to solve this problem with the images but I can't find the answer. I'm trying to display an 'ImageField' of my models to a template. I have uploaded an image through the admin site, and when I want to display it, I can't…
Jim
  • 541
  • 1
  • 7
  • 15
0
votes
1 answer

Django check if image was uploaded when saving ImageField

Is it possible, when calling ImageModel.save(), to check if an image file has been uploaded? For example: When creating the object, an image file should be uploaded in 99% of cases. If an image file is not uploaded, we may give an error or allow…
davidtgq
  • 3,780
  • 10
  • 43
  • 80
0
votes
1 answer

Django Display ImageField With Media Dir

I am using Django 1.9.3. I am trying to display media files uploaded by say a user (e.g. imageFields). HTML Page: {% for project in projects %} {% endfor…
ajl123
  • 1,172
  • 5
  • 17
  • 40
0
votes
0 answers

"IOError: cannot identify image file" while saving file content to ImageField in Django

How to save generated file content to ImageField in Django? My current code is: from django.contrib.contenttypes.models import ContentType image = create_screenshot(url) print type(image) # screenshot =…
EMiDU
  • 654
  • 1
  • 7
  • 24
0
votes
5 answers

Image Upload Field not working in Django

I am trying to render a form which will upload image. But I am not getting it. Here models.py: profile_picture = models.ImageField(_('profile picture'),upload_to="profile_pictures" , blank=True, null=True,default="static/images/person.jpg") in…
user5268025
0
votes
1 answer

Django ImageField upload_to custom path based on custom function

I am trying to set upload paths in Django ImageField with the upload_to attribute with similar to below. Model image = models.ImageField(upload_to=image_upload_location(image="logo")) Function def image_upload_location(filename, instance, *args,…
Baz
  • 306
  • 1
  • 5
  • 12
0
votes
1 answer

DataImageUrlFormatString property Not working

I am working on old Asp .NET GridView Image Field this is My Sample Code I got this code from…
Neeraj Verma
  • 2,174
  • 6
  • 30
  • 51
0
votes
1 answer

Image not displaying Django 1.8 ImageField

Here's my models.py class Item(models.Model): author = models.ForeignKey('auth.User') name = models.CharField(max_length=200) price = models.DecimalField(max_digits=20,decimal_places=2) description = models.TextField() created_date =…
0
votes
1 answer

Human readable file name

Whenever I create an ImageField using a file called moon.png, Django, correctly following my configuration settings, puts the file in: campaign/primary-banner/2015/11/25/moon.png or campaign/primary-banner/2015/11/25/moon_RcJ3FuD.png And that is…
blueFast
  • 41,341
  • 63
  • 198
  • 344
0
votes
1 answer

Problems with Django ImageField upload

I have a question, I wrote peace of Djnago code, to upload profile picture for user, from admin area model works fine, but from website itself image cannot be uploaded, it seems that code is not even being called. Here is my code, could you check…
Tadas
  • 29
  • 5