Cloudinary not being recognized in Django

2019-09-04 07:50发布

问题:

Hey I am trying to replace storing files to using cloudinary in my django app. I add the following into my models.py

class RegisterUser(models.Model):
    user=models.OneToOneField(User,on_delete=models.CASCADE)

    biography = models.CharField(max_length=1000000,blank=True)
    research_place = models.CharField(max_length=1000000,blank=True)
    studies = models.CharField(max_length=1000000,blank=True)

    image = models.ImageField(blank=True,null=True,upload_to='uploaded_images',default ="uploaded_images/defaultReal.jpg")
    # cropping = ImageRatioField('image','200x200',size_warning=True) #width x height
    image2 = CloudinaryField('image')

    avatar_thumbnail = ImageSpecField(source='image',
                                    processors=[ResizeToFill(200, 200)],
                                    format='JPEG',
                                    options={'quality': 60})

    activation_key = models.CharField(max_length=50)
    key_expires = models.DateTimeField()
    class Meta:
        permissions = (
            ("has_uploaded", ("Has uploaded")),
            ("is_authenticated", ("Is authenticated")),
        )

and run make migrations but nothing happens. Then when I run the server I get the error that image2 column does not exist. anyonee know what is gong on?