Skip to content
Advertisement

Tag: django

How to get user id from the related field model in django?

views.py models.py I have two models 1. User model, 2. VendorDetails model (vendoruser is connected by foreignkey relationship with vendordetails) Here I save the User extra details (VendorDetailsForm) if the requested user is applying for a vendor. I could be saved the requested user details in VendorDetails Model. But when I am getting the requested user id, I can’t .

Why I am getting “Not Implemented Error: Database objects do not implement truth value testing or bool().” while running makemigration cmd in django

I am trying to connect Django with MongoDB using Djongo. I have changed the Database parameter but I am getting this error Not Implemented Error: Database objects do not implement truth value testing or bool(). when I am running makemigration command. Please can anybody explain why I am getting this error and how to resolve it? I have include settings.py

AssertionError: Cannot apply DjangoModelPermissionsOrAnonReadOnly

I have a problem with (I think) permissions. When I try to send post request via postman, I get following error: AssertionError: Cannot apply DjangoModelPermissionsOrAnonReadOnly on a view that does not set .queryset or have a .get_queryset() method. [29/Nov/2021 20:21:21] “POST /api/blog/category HTTP/1.1” 500 101581 Here are my views.py and category class. Also, I noticed that for some reason in

Pass video uploaded via django to cv2

I am uploading video via django and want to process it using cv2. This is how video uploaded via django is accessed. Next i want to pass it to opencv. I dont want to save video in disk first and then acess it via cv2 using following code I tried passing this video_obj to VideoCapture this way But i got

Django NoReverseMatch error – urls.py path appears to match

In a Django application I am building as a project for an online course, I am expecting a link in one template (entry.html) to direct to a path (“edit”) in urls.py with a variable in the url. This should initiate a function called edit in views.py and render the template edit.html. I am getting a NoReverseMatch error (“Reverse for ‘edit’

Advertisement