53👍
✅
View functions are called with the request and the arguments from the URL. So pass them:
response = view(request, pk=1)
7👍
I encountered similar error when I made a mistake of using get_object method in perform_create. Read why this wrong from documentation
perform_create(self,instance):
instance = self.get_object()
- [Django]-"settings.DATABASES is improperly configured" error performing syncdb with django 1.4
- [Django]-How do I get the object if it exists, or None if it does not exist in Django?
- [Django]-Why doesn't django's model.save() call full_clean()?
Source:stackexchange.com