As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [django]

Django is an open-source server-side web application framework written in Python. It is designed to reduce the effort required to create complex data-driven websites and web applications, with a special focus on less code, no-redundancy and being more explicit than implicit.

Filter by
Sorted by
Tagged with
0 votes
2 answers
28 views

getattr(): attribute name must be string?

My models.py class Simple(models.Model): class Inner(models.TextChoices): a = 'small','Small' b = 'medium','Medium' c = 'large','Large' id = models.UUIDField(...
aaaa's user avatar
  • 65
0 votes
0 answers
5 views

Is there a way to start an SQS listener alongside a Django web server on Elastic Beanstalk without causing the main thread to stop on AWS?

I am trying to set up a SQS listener that works alongside my django web server which is hosted on AWS Elastic Beanstalk. So far everything that I have tried has caused the main thread to just stop. ...
Andrew Webberley's user avatar
0 votes
0 answers
15 views

How to parse value from key in django template

First i want to explain what i want to achieve. at first this my query at view invoices = vendor.invoices.order_by('-due_date') this is the relevant model : class Booking(model.Models): ... ...
Andi Fathul Mukminin's user avatar
0 votes
0 answers
7 views

Strategies for Integrate Webpack 5 into a Typical Django Project

I currently use Django Pipeline, which I want to remove and switch to using Webpack 5. I've made some headway in learning Webpack but am currently trying figure out the best project file structure and ...
Jarad's user avatar
  • 17k
0 votes
0 answers
6 views

Issue with combining data from multiple Django apps into a single form option in admin back office

I'm a fairly novice developer, but I'm aiming to master Django by developing a multi-tenant SaaS application that lets users create their own online stores. I'm still at the beginning of the project, ...
DocteurDrice's user avatar
-1 votes
0 answers
18 views

two django user types

How do you create a doctor and a patient as users in your Django Python project with one view? how do I go about creating the two users? I have tried the role one but it is not working. please if you ...
Carol Lwaamba Kabanda's user avatar
0 votes
0 answers
8 views

"SHORT_DATETIME_FORMAT" and "SHORT_DATE_FORMAT" don't work in Django Templates while "DATETIME_FORMAT", "DATE_FORMAT" and "TIME_FORMAT" do

I use DateTimeField(), DateField() and TimeField in MyModel class as shown below. *I use Django 4.2.1: # "models.py" from django.db import models class MyModel(models.Model): datetime =...
Kai - Kazuya Ito's user avatar
0 votes
0 answers
12 views

How to save each user's index from Llama index to PostgreSQL database in chatGPT clone app

I am trying to make a chatGPT clone that can answer on external data (private data) using React, Django, OpenAI API, PostgreSQL, and Llama index, precisely speaking, in context learning. Then, my ...
user21938333's user avatar
1 vote
1 answer
21 views

How do I calculate the total number of likes for all of a user's posts in Django?

I'm working on a Django project and I'm trying to calculate the total number of likes for a user based on their posts (i.e if a user has post with 10 likes and another with 5, the total likes must ...
Karmin Mahmood's user avatar
0 votes
1 answer
29 views

Why does Django raise a NoReverseMatch error when using the 'entry' iterator in a For loop and url method?

NoReverseMatch at / Reverse for 'entry' with keyword arguments '{'title': ''}' not found. 1 pattern(s) tried:['wiki/(?P[^/]+)\Z'] Line 12. {% extends "encyclopedia/layout.html" %} ...
Angeluz's user avatar
0 votes
0 answers
11 views

Django DRF Serializer slice amount in list of nested field based on user

I want to ask how to slice a nested lists in DRF. I have models Store, Manager, Products. Serializer returns store object with a nested fields. What I want to do is to slice the values, to NOT return ...
Uldis's user avatar
  • 13
0 votes
0 answers
14 views

Django strange static behavior

I launched the small Polls app from Django tutorial here: https://docs.djangoproject.com/en/4.1/intro/tutorial06/ The first time i wrote it, all worked fine. Then I tried to add the same style to all ...
Nikoi Nikoi's user avatar
0 votes
0 answers
13 views

Integrating Firebase authentication with Django (DRF)

I am developing a Django (DRF)/React web application and have integrated Firebase authentication using the email/password provider. The application requires additional user data, and I aim to link the ...
AminA2's user avatar
  • 168
0 votes
0 answers
17 views

how to create dynamic and interactive(clickable) collapsible topology graph using django

how to create dynamic and interactive(clickable) collapsible topology graph using django i have 3 csv files. 1 icon folder for png files. 1- relational object csv such as below SName|TName|SIcon ...
dony's user avatar
  • 3
0 votes
0 answers
12 views

Python/flask/django. I want to make a program similar to discord/teamspeak 3 using django/flask. Question below:

Which libraries should be used in order to make voice chats like in discord/teamspeak and how can this be implemented in the program code (by clicking on the voice. chat a person enters it)? I made ...
Kirito2004's user avatar
1 vote
1 answer
17 views

null value in column "name" of relation "contact_contact" violates not-null constraint

DETAIL: Failing row contains (9, null, miarisoa00@yahoo.de, , null). IntegrityError at /contact/contact/ null value in column "name" of relation "contact_contact" violates not-...
Claude Ihany's user avatar
0 votes
0 answers
11 views

Adding request.user to model field in django rest framework upon form submission

I am working on an app using Django and React and I use DRF to create APIs. I have a form that contains a field called submittedUser that I want it to define the user that posted the form in models.py ...
Mostafa Mohamed's user avatar
-1 votes
0 answers
12 views

Problem with Django Forms to filter by models' field with many to many relationship

If you have any other ideas on how to solve this, I'd love to hear it. The main idea is that the user can enter a list of products and then he will be returned a list of Dish model objects that has at ...
Kacper Włodarczyk's user avatar
0 votes
0 answers
9 views

Receive input in file format from swagger form (Django)

# model class User(AbstractBaseUser, PermissionsMixin, CommonModel): phone = models.CharField(max_length=20, unique=True) nickname = models.CharField(max_length=20, unique=True) ...
aiden's user avatar
  • 33
0 votes
0 answers
21 views

'User matching query does not exist' when adding a like to database

As the title says, I'm trying to make a like button as a many to many where if a certain verse(or post) is liked by a certain user, a like is added to the database, and if a user unlikes a verse, a ...
Soothingcube3's user avatar
0 votes
0 answers
13 views

cant pass data between Django and Chartjs

I wanted to pass an array to chartjs for a chart the data is getting passed but for some strange reason the data gets changed, the array contains days of the month [1,2,3,so on] but on chart it ...
Mt Khalifa's user avatar
0 votes
0 answers
9 views

Unable to see Django project on domain/ip address after Linode deployment - what could be wrong?

I am trying to deploy my django project on linode for my domain address.But I couldn't see project on domain/ip address. I created the existing domain on Linode servers. I set the records as default (...
naeuurr's user avatar
-1 votes
0 answers
18 views

How to calculate the number of hours spend inside and the number of hours spend outside for the employee face recognition attendance?

In my company we need to develop an application for the employee face recognition attendance. Per day, an employee after his first entry at 7:30AM can exit and entry several times before the leaving ...
Mohamed Abdillah's user avatar
0 votes
0 answers
15 views

Langchain cannot create index when running inside Django server

I have a simple Langchain chatbot using GPT4ALL that's being run in a singleton class within my Django server. Here's the simple code: gpt4all_path = './models/gpt4all_converted.bin' llama_path = './...
Rocky C.'s user avatar
0 votes
0 answers
26 views

Can someone please fix my search bar in Flutter?

I'm trying to make a searchbar, where I can search data from my Django API. Right now I can find shows by name, and when I'm deleting my prompt it doesn't update. I would also like to find shows by ...
amyhawks's user avatar
-1 votes
0 answers
12 views

Why is my React app not getting data from the Django backend after uploading to the server?

After uploaded the React app to the server, it does not get data from Django Backend. I uploaded my Django backend to the server. After that I checked the API endpoint, it works. Then uploaded the ...
Shahriar Iraj Ifti's user avatar
0 votes
0 answers
9 views

Django+docker compose+NGINX+aws+RDS+postgreSQL deployment and ports flow

Hi I developed a simple personal blog with Django and Nginx as a reverse proxy server and want to deploy It with AWS in the most costo effettive way. Which Is It? And I don't understand the ports flow ...
Franaz's user avatar
  • 1
0 votes
0 answers
12 views

version_id shows as null when creating a verse

Whenever I try to create a new verse, version_id appears as null in the payload under the network tab in dev tools, and this error also appears: POST http://localhost:8000/verses 500 (Internal Server ...
Soothingcube3's user avatar
0 votes
0 answers
11 views

Troubleshooting an empty HTML console log bar in Django with Python asyncio

HTML console log bar is empty. I was trying to redirect the log messages from my terminal to an HTML console log on my Django webpage. the console log bar is created in the html page but is empty, not ...
samavi_nasir's user avatar
0 votes
0 answers
13 views

Sorting warnings by accumulated count and date within a specified date range in Django

I have a Django project where I need to sort warnings based on the accumulated warning count (warning_count) and the date (date) within a specified date range (start_date and end_date). Here is my ...
chea's user avatar
  • 101
0 votes
0 answers
24 views

Not able to change IST to UTC

Current IST (Asia/Kolkata) is 5:23 PM and UTC is 11:53 AM same day. I wanted to convert IST to UTC. I tried following: from dateutil import tz from datetime import datetime from_zone = tz.gettz('IST')...
MsA's user avatar
  • 2,449
1 vote
1 answer
29 views

Is there a way to exclude fields in nested serializers with a dictfield?

I am trying to serialize a dictionary in the structure of: dict = {'outer_dict': {'inner_dict1': {'key1': 'value1', 'key2': 'value2'}, 'inner_dict2': {'key3': 'value3', 'key4': ...
SHaringT's user avatar
0 votes
0 answers
20 views

"DATETIME_INPUT_FORMATS" doesn't work in Django Admin while "DATE_INPUT_FORMATS" and "TIME_INPUT_FORMATS" do

I use DateTimeField(), DateField() and TimeField in MyModel class as shown below. *I use Django 4.2.1: # "models.py" from django.db import models class MyModel(models.Model): datetime =...
Kai - Kazuya Ito's user avatar
1 vote
2 answers
34 views

Django checkboxes not saving to database: What am I doing wrong?

Value of checkbox when clicked is not saved in database Django. I am creating a website to track the progress of printing a book. The data is not being saved in the database and i don't know why. I ...
Ahmad Nasr's user avatar
0 votes
0 answers
19 views

Font awsome icons are not showing

In return () i used fa fa-pencil-square and fa fa-trash-o but icons are not showing. why its not showing the particular icons from font awsome? import { useState, useEffect } from "react"; import {...
M Junaid's user avatar
0 votes
0 answers
13 views

Apache showing the static and media file directory

I am hosting a django website on digital ocean using the Apache server. And using apache to serve my static and media files. For that I have edited the 000-default.conf file as follows `<...
Vinay Khatri's user avatar
0 votes
0 answers
7 views

How to override the view signup class in Django-Allauth to redirect the user to an error page when the form is not valid?

Does anybody know how to override view signup class (when form is not valid need redirect to some page)? class AccountSignupView(SignupView): template_name = 'example.html' form_class = ...
rytpiQWE's user avatar
2 votes
1 answer
47 views

Checking if varchar column value containing IP address is in subnet

In SQL (tried in pgAdmin) I am able to do SELECT * FROM ... WHERE inet(s.ip_address) << `10.0.0.2/24` I tried to convert it to django ORM code which contained following: ... .filter(...
MsA's user avatar
  • 2,449
-2 votes
0 answers
12 views

During mysqlclient installation I get this error

(venv) D:\Habibullah\DjangoProjects\Projects\firstProject>pip install mysqlclient Collecting mysqlclient Using cached mysqlclient-2.1.1.tar.gz (88 kB) Preparing metadata (setup.py) ... done ...
Habibullah Ahmadi's user avatar
0 votes
0 answers
19 views

Django model field name suggestions (autocomplete) in VSC

Is it possible to have in VSC help text during creation of object? Example: class Fruit(models.Model): name = models.CharField(max_length=100, unique=True) and now somewhere else in code: Fruit....
skelaw's user avatar
  • 183
0 votes
1 answer
24 views

django many to many form is not showing model str

Models.py class Person(models.Model): name = models.CharField(max_length=128) email = models.EmailField(max_length=128, unique=True) courses = models.ManyToManyField('Course', through='...
Gabriel Siahaan's user avatar
0 votes
0 answers
22 views

Error seen when adding data to new model due to possible id issue

I am using Django and MongoDB. I have two models that are very similar. I decided to make a second one as a "v2" for some testing before wiping out my original. After I created it and then ...
getunstuckaq's user avatar
0 votes
1 answer
30 views

How to update post with multiple images in django templates

i have two models 1-post 2-postimage so the post can have multiple images so I'm having a trouble to update the post and its images in my templates i did like upload multiple images when i create a ...
7mood's user avatar
  • 5
0 votes
1 answer
25 views

how to sort results by 2 columns, limit prefetch result to one record and sort by prefetch column

I have multiple issues that I couldn't solve by my own. in CaseManager.get_queryset() : I'm trying to add a where clause that the case__id is equal to movement__case__id as: queryset=Movement....
DeaDSouL's user avatar
  • 183
0 votes
0 answers
24 views

multiple order instances created when the page is refreshing

I'm getting the billing address and display it in the payments page but the problem is that when i refresh the page it's create an other instance in the admin panel I tried the get_or_create but it ...
Singa Pora's user avatar
0 votes
0 answers
14 views

Django/HTMX - How to stop resetting selected option when search form is submitted?

I want to implement a search form that has a Product ID field and a and Product locations select field in which the list of locations should be populated based on the Product ID entered. For the ...
DEV's user avatar
  • 65
-1 votes
1 answer
16 views

How to update a post in Django using the same manual-written form for creating it?

I have a form in which I can create a new post, which works perfectly. Now I want the same form to be filled when clicking on a link in order to update the post. I've found lots of tutorials, but all ...
unix nexo's user avatar
1 vote
1 answer
21 views

DJango: Textarea/Form get, process and show

Good evening, i'm currently working on a small DJango project, and am currently facing an issue: The whole of the project is to provide a textarea to the user: 1- let the user write down the text that ...
TheMailOfWork's user avatar
0 votes
1 answer
14 views

What am I missing to have 'move_up_down_links' display on 'ListAdmin' page using django-ordered-model?

I use django-ordered-model==3.7.4 in my project to create an ordered model. I want to have a way to reorder list items via Django Admin. I tried to use example code from django-ordered-model's docs, ...
Hazadus's user avatar
  • 68
0 votes
1 answer
17 views

Django channels consumer how to disconnect at server side

I'm trying to write a log file viewer with django, channels, but only the first connection works well, while I refresh the frontend, websocket will connect fail. After some search, I found the loop is ...
lufy's user avatar
  • 13

1
2 3 4 5
6141