Django.urls.exceptions.NoReverseMatch - AGAIN!


#1

Hi,
I haven’t been coding in Django for quite some time as I have been busy at work amongst other things. However, I started again following the books and now I have come across this problem with no reverse match.
I absolutely hate these particular errors as I find the error descriptions are about as useful as a chocolate teapot. It would be more helpful if they actually pointed to the origin of the error.
I have spent 2 or 3 days trying to determine the cause of the following error and at the moment I am losing hair over it. It’s driving me nuts and also makes me lose interest in Django.

NoReverseMatch: Reverse for 'stockitem_detail' with keyword arguments 
'{u'slug': u'#NAME?'}' not found. 1 pattern(s) tried: 
['stockitems/(?P<slug>[-\\w]+)/$']

I have my code on bitbucket - https://bitbucket.org/DavidJ61/inventory/src/179300c1df86101600564d8e24207cb84af6f46b?at=master
and I would be eternally grateful if someone could point me to the error of my ways. I have continuously googled and compared code and for the life of me, I cannot see the fault.

Regards

David


#2

This has now been sorted. I coukdn’t find anything wrong with the code and it was structured exactly as in the Hellowebapp book.
I cleared the database of the imported data and all is now well. Although I did not see any problems, I am suspecting there were possible data corruptions.

David