20,103 questions
-2 votes
1 answer
47 views
Django Not Saving Form Data [closed]
I fill the Django form in contact.html file. But form data is not saved in database or another place. There is no error or warning while saving the form data. Form screenshot: Form screenshot. views....
0 votes
1 answer
38 views
Certain django-select2 fields won't render when multiple forms are used on single template
I have an issue rendering some select2 fields: When multiple forms with same select2 widget are used within a single template some select2 fields are not rendered as expected (rendered just as normal ...
1 vote
1 answer
104 views
Django: User Experience for checking if a person already exists in the database (first and last name, and birthday)
[I'm sure my use case has been addressed somewhere, but I'm not finding it.] In this use case, the user is registering a new person with the following fields: first name, last name, and birthday. If ...
0 votes
1 answer
99 views
How to reset password in a Django UserChangeForm
I have a basic CustomUser model in my project. When I want to update it I fill my form with instance where I try to make user's password null, but anyway in the form I receive: "No password set. ...
1 vote
1 answer
72 views
How to parse multipart/form-data from a put request in django
I want to submit a form to my backend and use the form data as the initial value for my form. Simple stuff if you are using a POST request: def intervals(request, **kwargs): form = MyForm(initial=...
1 vote
1 answer
47 views
How can I split the two forms so that only one of the two forms in the template is processed?
I am trying to place two independent forms on one template. I have them placed but there is a problem that both forms are being checked. Validation of both forms is being checked. Although I only have ...
1 vote
1 answer
22 views
How can I filter values from one model and insert the result into the form as choices?
Good day! I have two tables - models. I fill them gradually. First I have the first table. First I enter data into the first table. And there - in the first table I have - repeating data. Field - (...
0 votes
0 answers
24 views
correct way to sanitize CKEditor input and prevent XSS
I'm using CKEditor in my Django project to allow users to submit rich text content. However, I'm encountering an XSS alert when testing with code like: alert('hello') To prevent this, I used the ...
0 votes
1 answer
55 views
How to select from the second field in the form - filtering data depending on the values of the first field?
Is it possible to somehow adapt something similar to my problem? I would like a list to appear in the form based on data from another list Select from the second field - filtering data - (contents) ...
2 votes
1 answer
67 views
How can I configure the wrapping of a large long line of text in a form Django?
I have a form with OneToOneField where data is loaded from another table model. But I often have large data sizes there and the displayed text does not fit into the window size. Is it possible to ...
1 vote
1 answer
39 views
How can I fill in related models separately through forms (OneToOneField)?
I have two table models. I write data to one of them using a form. I also want to write data to the other model table using a form. But I'm trying to link these tables. Use the first one as a base. ...
1 vote
1 answer
53 views
Django Field errors not displaying
Here is my forms.py code: from .models import User class userRegistrationForm(forms.ModelForm): password = forms.CharField(widget = forms.PasswordInput()) confirm_password = forms....
1 vote
1 answer
46 views
'User' object has no attribute 'profile' - Django profile update problem
I am new to Django and currently learning and I have encountered a problem that I just can't seem to solve. from django.shortcuts import render, redirect from django.contrib import messages from ....
3 votes
0 answers
160 views
Python Django Admin Form: show inline without rendering a form
I have a Django admin page which allows me to edit a model in my domain. The ModelAdmin looks like this: @admin.register(models.VehicleTemplate) class VehicleTemplateAdmin(ModelAdminBase): ...
0 votes
1 answer
96 views
Working in django with data with a saved history of changes
I am creating an information system in which some entities have separate attributes or a set of them, for which it is necessary to store a history of changes with reference to the date of their ...