Relative Content

Tag Archive for djangodjango-modelsdjango-viewsdjango-formsdjango-templates

Password field in Signup/Login form not appearing properly | Django | HTML | Bootstrap

I am trying to create a custom signup form using HTML, CSS, Bootstrap as front end, and Django as backend, when I create the form, firstname, lastname, and email are appearing as required, but the password and confirm_password fields are not appearing as required, from forms.py, the widget’s placeholder and class=form-control is also not being applied to it.

Is there an way to go around the “Field ‘id’ expected a number” when dealing with a queryset?

I am working on a learning platform. I want to be able to track user progress of the chapters completed. I cerated a new model and inserted it into the html using a form. However when I submit, I keep getting a TypeError with the specifics that “Field ‘id’ expected a number but got <QueryDict: {‘csrfmiddlewaretoken’: [‘YMvOO6ZYGWVVfxfgoFLVEanZ9zK70CrqlRIx5Y2LOkbzH8Mx3UHPlQYczqLbq1Qt’], ‘chapter’: [‘2’], ‘completed’: [‘on’], ‘student’: [‘1’]}>

My form is automatically being submitted in django whenever I open the link

Well I am creating a admin approval view for an account upgradation but it is not working as I expected. I wanted to get a form and then depending upon the data the form is either approved or rejected. I have created the form and everything else but the form is automatically submitting without even rendering along with all that it is getting approved too. Help me please.
Model: