'relation "itouch_photo" does not exist [duplicate]
i have an app hosted in heroku while i did not set debug = false, when i visit the website it's throws me an error like this:
relation "itouch_photo" does not exist
LINE 1: ...ch_photo"."price", "itouch_photo"."location" FROM "itouch_ph...
and also it highlight my template:
{% for photo in photos reversed %}
I did not use command prompt i developed an app through heroku dashboard.
how can i slove that:
the models:
class Photo(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
category = models.CharField(max_length=30,null=True, blank=False)
image = CloudinaryField('image')
description = models.TextField(null=True)
date_added = models.DateTimeField(auto_now_add=True)
phone = models.CharField(max_length=12, null=False, blank=False)
price = models.CharField(max_length=30,blank=False)
location = models.CharField(max_length=20, blank=False)
def __str__(self):
return str(self.category)
the views:
def dashboard(request):
photos = Photo.objects.all()
context = {'photos': photos}
return render(request, 'dashboard.html', {'photos': photos} )
def home(request):
photos = Photo.objects.all()
context = {'photos': photos}
return render(request, 'home.html', {'photos': photos} )
i think the problem is coming from this model up here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
