Django Querysets adding additional information inside View

I’m currently working on a small django application for my school. I got two models involved in this problem: “category” and “device”, which are connected in a one-to-many …

why is day out of range?

i am trying to add a date to an application that I am writing. the apllication is actualy a list of activities. when i tried to add a datefield to the ui and save it into my database. i got this error …

Add time in django Models.py

I tried subtracting two times in models.py but I got error. Here is my model That I have been working. class Schedule(BaseModel): bus_company_route = models.ForeignKey(BusCompanyRoute, on_delete=…

maximum recursion depth exceeded when using Django redirects

I’m experiencing this error where when I try to redirect a user to a webpage using Django, it showed me this error maximum recursion depth exceeded views.py from django.shortcuts import render, …

(django) Showing posts according to interests of users

I am pretty new to Django and still learning it, but I have to create something like medium.com. I want to show posts to users according to their interests. I added an interests field with a checkbox …

Django React Serving Together Page not found (404)

I develop an application using Django and React. I want to serving Django and React together. I create an build in react. I use it in Django. This is urls.py ; urlpatterns = [ url(r’^$’, views….

Update Query list in Django

I’m having a trouble on how can I automatically update my amount_unpaid when the time I updated my amount_paidcolumn. The result of amount_unpaid should be subtract my amount – amount_paid = …

How to autofocus a Charfield in a Django ModelForm

In my django app I want to set focus to the first CharField (task) when the page loads. my models.py is from django.db import models class ListModel(models.Model): task = models.CharField(…

AJAX post request with django and python

I am trying to build a web app on django where a user can record something which then gets turned into text and after that sent to the server with AJAX. I did some research and found this article: …

How to use get_or_create? Error: get() returned more than one Patient — it returned 7

I have a function for fetch API where I create a Django model object for each object in the JSON and store the data in django model. The problem here is everytime I call the route it creates the …