Cloudinary not being recognized in Django

随声附和 提交于 2019-12-12 03:24:55

问题


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?

来源:https://stackoverflow.com/questions/36806461/cloudinary-not-being-recognized-in-django

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!