For what I can see in the issue, you're passing 2 values to the url (id , topic)
Maybe the error its for the topic because of the value (/Subject/Django) try to sanitize the value after store it in the database, because it try to get the url
example.com/3//Subject/Django where 3 its the id or pk and /Subject/Django its the topic, for the web server it may be confusing. You can sanitize the value for something like slug field (
django slug field docs). Even better, I suggest add slug field to the model and leave the topic off the url.