Getting this error when submitting the form associated with this view. Not sure what exactly is the problem, considering I have a form with a very similar structure and it works
I am using Django version 2.2.12,
Here is just another example this works fine for me :
models.py
from django.db import models
class Book(models.Model):
title = models.CharField(max_length=256)
author = models.CharField(max_length=256)
pages = models.IntegerField()
price = models.FloatField()
views.py
from django.views.generic import ListView,DetailView
from testapp.models import Book
class BookListView(ListView):
model=Book
class BookDetailView(DetailView):
model=Book
urls.py
from django.contrib import admin
from django.urls import path
from testapp import views
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.BookListView.as_view()),
path('/', views.BookDetailView.as_view()),
]