Skip to content
Advertisement

Tag: django-views

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 .

TypeError: expected str, bytes or os.PathLike object, not JpegImageFile (or PngImageFile) in Django

When I am uploading a picture to check a picture according to tensorflow h5 model, I am loading the image using load_model of tensorflow.keras.models but it is not accepting. For JPG, it is showing TypeError: expected str, bytes or os.PathLike object, not JpegImageFile and for PNG, it is showing as TypeError: expected str, bytes or os.PathLike object, not PngImageFile. What

Splitting dictionary objects

I am building a Blog App and I made a queryset which is showing blog date and likes of every day since blog date, But it is showing in dictionary and i am trying to show both instances differently in table like. Blog Date Likes 20 Sep. 6 Likes 21 Sep. 2 Likes 22 Sep. 4 Likes But it is

Django Model form not rendering

Im trying to create a model form on django but it doesnt want to render even though I mapped it properly and created the path. models.py forms.py views.py it refuse to render but it displays the html tag that is in the file but not the fields from the form. this is the html template AppsForm.html Answer you view is

Advertisement