Django/Heroku Deployment issue OperationalError at / no such table: posts_post
OperationalError at /
no such table: posts_post
Django Version: 4.1 Exception Type: OperationalError Exception Value:
no such table: posts_post
Exception Location: /app/.heroku/python/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py, line 357, in execute
Raised during: posts.views.index Python Executable: /app/.heroku/python/bin/python
Error during template rendering
In template /app/templates/index.html, error at line 31 no such table: posts_post Code Highlighted in error is my Index.HTML File obj in object_list
</section>
<section class="featured-posts no-padding-top">
<div class="container">
<!-- Post-->
{% for obj in object_list %}
<div class="row d-flex align-items-stretch">
{% if not forloop.first and not forloop.last %}
<div class="image col-lg-5"><img src="{{ obj.thumbnail.url }}" alt="..."></div>
{% endif %}
<div class="text col-lg-7">
<div class="text-inner d-flex align-items-center">
<div class="content">
<header class="post-header">
<div class="category">'''
Traceback to views.py file
/app/posts/views.py, line 51, in index( Highlighted line in error return render(request, 'index.html', context))
def index(request):
featured = Post.objects.filter(featured=True)
latest = Post.objects.order_by('-timestamp')[0:3]
if request.method == "POST":
email = request.POST["email"]
new_signup = Signup()
new_signup.email = email
new_signup.save()
context = {
'object_list': featured,
'latest': latest
}
return render(request, 'index.html', context)
'''
I have tried solving it by removing pycache from my apps along with making migrations again however it throws same error..
Can anyone here help on this?
Thanks