
When you try to then access shapefile later, it tells you that shapefile is 'NoneType' (rather than the. When something like () fails, it usually returns None, which, in your case, gets assigned to your variable 'shapefile'. That usually means that an assignment or function call up above failed or returned an unexpected result. So basically, what this is saying, in Python speak, is that your attempt to open the shapefile failed. but I get this error 'Image' object has no attribute '_committed'. NoneType means that instead of an instance of whatever Class or Object you think youre working with, youve actually got None.


Return render(request, 'img/new_egami.html', )Īs you can see, I first create a image variable with the value of the uploaded image, I flipit using ImageOps() then I save the result in a model instance. Traceback (most recent call last): File 'toon.py', line 17, in img cv2.imread(FLAGS. Return redirect('img:detail', id=form_image.id) I'm using this form: (forms.py) from django import formsĪnd this is my views.py: from django.shortcuts import render, redirect, get_object_or_404įorm = ImageForm(request.POST, request.FILES) Visit One News Page for Giant Planet news and videos from around the world, aggregated from leading sources including newswires, newspapers and broadcast media. If trying image.save ('somefilename.jpg') works and creates teh correct file locally, it's probably that. Image = models.FileField(null=False, blank=False) As a wild guess, the filefield in ImageClient.image doesn't like being given a (potentially anonymous) pillow.Image object to save, and would rather you save it first and pass a filename, or actually pass the file contents directly. This is my models.py: from django.db import models R News CHANGES IN R 3.4.0 SIGNIFICANT USER-VISIBLE CHANGES (Unix-alike) The default methods for download.file() and url() now choose 'libcurl' except for file:// URLs. Hello, I'm new to Django and I'm trying to do this project where I handle the user's image and flip it horizontally.
