Category "django-views"

Why the html custom form is not working django

I have a contact page with a simple form. Here is views.py: def contact_view(request): if request.method == 'GET': form = ContactForm() else: form = Con

Django: How to return an inline formset with errors

I have created a form to sign up a user by having them create a User object and a UserProfile object as follows: class UserCreationForm(UserCreationForm): c

How to delete multiple records from different classes in django?

It seems that whenever I run it and delete records I get server error (500) but it deletes the the data of class Bscs1_1 but for the rest of the classes it does

How do I display a Django form correctly using ListView

I am writing a simple app to track sales leads based on the Django tutorial "Writing your first Django app" (https://docs.djangoproject.com/en/4.0/intro/tutoria

Django Authorization Checking in URL having wild card pattern

I am trying to implement permission checking mechanism in URLs for a request using wildcard techniques, rather than implement permission checking on each views.

download to csv the result of a search in Django

I am trying to download a CSV from the result of a search, as an option. Meaning that the user should be able to do a search and view the result in a template,

Django profile picture does not upload

This question was asked I don't know how much but it doesn't give my answers The app I was gonna make is a little blog webapp from a tutorial (for some training

Django: After updating a template, the changes are not reflected upon refreshing the page in the browser

I am testing a class based view in my Django application. I am currently in development, so I want to see changes in the browser as soon as I make any change in

Ho to create serializer for model having foreign keys to access that foreign keys tables data also?

I want to rewrite the following API in a more efficient way using the serializer. In the following API, the user and group are foreign keys. I want to return al

Django form with dropdown list using Database returns empty fields

I'm discovering Django and I'm trying to develop a simple application. I have three tables in my database : One big table to report all the information to users

in Django : Why nothing happens when I try to Create new note with the html form in the notes.html page

I've just started my first app with Django by following a video on YouTube. The app is a students dashboard with 8 tools and features to help the student to mak

Django Rest-Framework search-fields wont work inside @action

I'm trying to use the search field offered by DRF inside of an action, but it seems to not work. I had a similar problem paginating inside of the action but fou

I want to make a User to User Private Live Chat App with React & Django

I'm really confused about that. I want to make a user to user chat app on my project with Django and React. I've tried create a model and fetch messages with Re

How do I Concatenate or Combine the dictionary of same data to One

I have the below set of 7 Dictionaries {'empid':785, 'empname':'Ibrahim', 'date(2022,5,1)':'Unmarked'} {'empid':785, 'empname':'Ibrahim', 'date(2022,5,2)':'Unma

django django-yearmonth-widget display month as month name

I have used package "django-yearmonth-widget" to have year and month selection and not complete date. Here, day is fixed i.e. 1st of every month. This implement

local variable 'search_keyword' referenced before assignment

I have been working on a search form and it's giving me this error when i open the url or submit the form. I am watching a codemy django tutorial and the only t

django don't show form in template

django dont show my form in my template where is the problem? forms.py from django import forms class QuestionForm(forms.Form): massage = forms.CharField(w

Is there a Django library that automatically display local currency based on a visitors country IP address

I'm trying to integrate a functionality on an Ecommerce website in Django, Where visitors are automatically shown local currency base on their country IP addres

I would like to run for loop to each of li tag and want to add content dynamically from django backend admin

I have created a navbar and content can be added from the backend but only the home nav bar shows the icon and the other navbar name is with the same icon. I wa

Django: how to count the ratings and reviews of a post using django?

i have a model course and i also have a model review and rating that allows users rate a particular course. now i want to count all the ratings on each course w