All Questions
5,713
questions
-1
votes
0
answers
24
views
Template Rendering Issue [closed]
I have done Url shortner using django in Python. I am unable to render the template and getting the error as shown:
)
I have tried some methods and tried ChatGPT, somehow I didn't meet with the answer ...
0
votes
2
answers
33
views
Django - dropdown (select widget) in form is not saving data to db
I'm using this form to get a dropdown menu in my html form :
forms.py
class forms_bdc(forms.ModelForm):
[...]
bdc_description_1 = forms.ModelChoiceField(required=False,queryset=...
0
votes
1
answer
25
views
Django - get value of a form textinput on onchange event
I am using this to get the ID and the value of a select item in a form in django with the onchange event:
class forms_bdc(forms.ModelForm):
[...]
bdc_description_1 = forms.ModelChoiceField( widget=...
0
votes
0
answers
15
views
Django Admin updating tabularinline forms
I have a django modeladmin like so:
Class PlanInline(admin.TabularInLine):
model = Plan
form = PlanForm
Class SettingsInline(admin.TabularInLine):
model = Settings
form = ...
0
votes
0
answers
21
views
I am not able to upload MEDIA Files in Django Vercel server
I get this error:
ClientError at /dashboard/add-profile-details
An error occurred (400) when calling the HeadObject operation: Bad Request
Request Method: POST
Request URL: https://www.karlowebsytz....
0
votes
0
answers
40
views
How to send authentication session id to django backend using fetch api?
saveBtn.addEventListener('click', function() {
const csrftoken = getCookie('csrftoken');
fetch('http://localhost:8000/card/{{ auction.slug }}/add/', {
method: 'GET',
...
1
vote
1
answer
55
views
Only first placeholder displayed in Django's UserCreationForm
I'm trying to make a sign-up page with a customized user creation form - add placeholders to the fields. I'm trying to do it this way:
forms.py
class SignUpForm(UserCreationForm):
email = ...
0
votes
0
answers
16
views
Problem when trying to include Allauth form in django template
I have this custom form
templates/account/signup.html
{% load i18n %}
<h2> custom {% trans "Sign Up" %}</h2>
<form class="max-w-[500px]" method="post" ...
0
votes
1
answer
48
views
How can I implement few checkboxes in a Django Form?
I was given a task to create a recipe website. A user can add a recipe. They have to choose a category (categories). One recipe can belong to one category or to several. I am inheriting my Form from ...
2
votes
2
answers
50
views
How to add a ForeignKey field to be saved in ModelForm Django?
While creating my website, I face the following problem: a user can add an article, and so the article model has a ForeignKey field - author.
I created a form for adding it, inheriting from ModelForm, ...
0
votes
0
answers
38
views
Issue with creating new pigeon and his parent records in a Django form
I am new to programming and currently learning Django. I am working on a web application where users can register new pigeons into a database. The registration form includes fields for the pigeon's ...
0
votes
0
answers
14
views
Django form to save m2m additional fields (using custom through\assosiation table)
I have a "Recipe" model, which contains multiple "Product" models and the relationship between Recipe and Product holds the quantity of the products. Thus, I need a custom ...
0
votes
2
answers
64
views
I cannot create a pre-filled form in python django
I am doing a simple project to practice CRUD in Django and I am working on a simple "To Do" project and these area my codes.
models.py
from django.db import models
# Create your models here....
-1
votes
2
answers
44
views
Cannot get Django ModelForm to display neither connect custom HTML form to database
I am currently creating a Django app that is a rental apartments homepage. It is supposed to have a booking form connected to a database. However I can't get the form from forms.py to be displayed on ...
0
votes
1
answer
47
views
Django route cannot be accessed during fetch POST method but can be accessed during manual GET method
When I attempt to delete a faction from my application using the route saga/delete/2 after clicking the deleteSubmit button, the program returns the following error:
"POST /saga/delete/2/ HTTP/1....