311,566 questions
Advice
0
votes
1
replies
26
views
Best practice to switch between development and production urls when using Vue/Vite and Django
I want to build a website with Vue/Vite as frontend and Django as a backend.
When my frontend needs to get data from the backend I currently do something like this (which works perfectly fine):
const ...
2
votes
1
answer
67
views
How to disable Celery startup logs?
I'm getting a bunch of logs like this:
[2025-11-29 16:13:15,731]
def group(self, tasks, result, group_id, partial_args, add_to_parent=0):
return 1
[2025-11-29 16:13:15,732]
def xmap(task, it):
...
0
votes
0
answers
36
views
Connecting Django Rest API with React Native Application Issue [closed]
I made a system to help the company with a task work, and hopefully, be noticed to work with the development team.
One of the things that's mandatory for my project is its compatibility for mobile ...
-3
votes
0
answers
29
views
Paystack integration with Django [closed]
I'm trying to integrate paystack into my django E-commerce but I keep getting this error, ❌ Order creation error: [WinError 10061] No connection could be made because the target machine actively ...
2
votes
1
answer
64
views
How do I make a custom field output different datatypes depending on file asking for data?
I'm building a molecule properties displaying website using django and sqlite. The database takes a numpy array and stores it as a BLOB. Currently, it just outputs the numpy array back out when asked ...
0
votes
2
answers
67
views
API request tracing with NextJS, Nginx and Django
I’m trying to measure the exact time spent in each stage of my API request flow — starting from the browser, through Nginx, into Django, then the database, and back out through Django and Nginx to the ...
-2
votes
0
answers
77
views
get the data from the server with fetch API [closed]
i get the data from the server with fetch API it contains html, when i click on load more posts button it should load the html at the bottom of the page we got from the server, but it also loads the ...
Best practices
1
vote
5
replies
83
views
How should I structure a Django backend with a Vue 3 frontend for a news application?
I’m building a small “newsroom” application where Django handles the backend (API, authentication, admin) and Vue 3 handles the frontend UI. I’m still fairly new to combining Django with a modern ...
-3
votes
0
answers
61
views
Nginx not serving static files [closed]
Hi everyone I am trying to upload a application using Nginx, Gunicorn, Django application run fine in development environment but for production it does not serves static files. I tried hard but ...
-4
votes
0
answers
63
views
Restarting backend container became unreachable for traefik(504 Gateway timeout)
I’m having a problem and I can’t find a solution.
I have deployed a Django backend and a React frontend using Docker.
I’m using Traefik as a reverse proxy for the web server. When I start Traefik, the ...
-3
votes
1
answer
105
views
how do I get html page with fetch for reload part of the page?
I am getting data from the server. The view must renders an html page without reloading the entire page، but this renders whole page including the header of current page, this is a problem, each time ...
Advice
0
votes
1
replies
66
views
Django: Separate session expiry times for "normal" website and admin area
It would be nice if there were an easy way to define separate session expiry time for the admin area of a django website. So, admin users could log themselves into the "normal" website (seen ...
0
votes
1
answer
36
views
unable to make changes on DB or admin after crud operation./formset
I am building a mid-level project called School-Admin Panel with Django. I have completed most of the segments sucessfully, but I am having an issue with the performance forest.
The formset loads and ...
2
votes
1
answer
51
views
Displaying related items in an inline formset in Django
I have an inline formset in Django. I have a table called SubItem which is related to Item. Many SubItems to one Item. Some Items don't have any SubItems.
Sections of code are obviously missing from ...
Advice
1
vote
1
replies
77
views
How do I make reusable HTML elements in a Django project?
I'm new to Django, and I'm working on a project where I'm reusing static pages and changing them to be suitable Django templates. As a part of the previous project, I made some custom HTML elements ...
0
votes
0
answers
92
views
Django channels tutorial issue [closed]
As I am following the Django channels tutorial (here is the link:
https://channels.readthedocs.io/en/latest/tutorial/part_2.html
), I won't post any code except the specific problem I am having.
In my ...
-1
votes
0
answers
53
views
ajax request in django
I implemented the post like feature using ajax in the Django project, but it doesn't work. And it gives a 404 error in the console.
template.html
<script>
$(document).ready(function(){
...
-3
votes
2
answers
90
views
Python Django Rest Framework [closed]
What is the difference between decorator @api_view and @csrf_exempt in project level django rest framework? I need the difference and which is better to develop the project.
0
votes
2
answers
53
views
Django Summernote: How to delete attachment files from server when removing them from admin?
When I delete a file from the Attachment model (which is provided by django-summernote), the record is removed from the database, but the actual file remains on the server.
I want to make sure that ...
1
vote
1
answer
63
views
TailwindCSS utilities/classes always override static CSS styles [closed]
I try to use TailwindCSS and CSS (as static), but TailwindCSS utilities override the static CSS styles. I tried moving TailwindCSS invocation tags after, before static CSS invocation, but it didn't ...
0
votes
0
answers
79
views
iOS/web Auth Client ID Handling for Google Sign In
To preface, I'm not asking for a direct fix here, I'm just curious if what I'm doing is the appropriate auth flow for setting dynamic client ID based on device platform.
I am 2 applications that use ...
0
votes
0
answers
31
views
Flaky Circle CI tests (django): ImportError: cannot import name "task" from "app.tasks" (unknown location)
Sometimes, I have many flaky test failures due to one error:
ImportError: cannot import name 'task_import_events_to_db' from
'app.tasks' (unknown location)
It seems the tests fail because of this ...
0
votes
0
answers
31
views
KeyError 'email' for django-authtools UserCreationForm
I am experiencing an error for which I can’t find an origin.
I believe the error stems from GitHub - fusionbox/django-authtools: A custom User model for everybody!, and disclaimer, I have asked this ...
1
vote
2
answers
92
views
Django check at runtime if code is executed under "runserver command" or not
I've got a project based on django, that wraps some custom code.
During import, this code is loading some heavy file to be executed. I need to check whether imports are executed under "runserver ...
2
votes
2
answers
68
views
Django REST project doesn’t detect apps inside the “apps” directory when running makemigrations
I have a Django REST project where I created a directory called apps to store all my apps.
Each app is added to the INSTALLED_APPS list in my settings file like this:
INSTALLED_APPS = [
'django....
0
votes
1
answer
34
views
Cannot query "admin": Must be "ChatMessage" instance in Django
In View Function
it can show this error
Request Method:GETRequest URL:http://127.0.0.1:8000/inbox/Django Version:4.2.25Exception Type:ValueErrorException Value:Cannot query "admin": Must be &...
0
votes
0
answers
72
views
Is it reasonable to use Cloud storage for async webhook processing on Cloud Run
I'm processing webhooks on Cloud Run (Django) that need async handling because processing takes 30+ seconds but the webhook provider times out at 30s.
Since Cloud Run is stateless and spins up per-...
0
votes
0
answers
70
views
Django ORM: Add integer days to a DateField to annotate next_service and filter it (PostgreSQL)
I am trying to annotate a queryset with next_service = last_service + verification_periodicity_in_days and then filter by that date. I am on Django 5.2.6 with PostgreSQL. last_service is a DateField. ...
-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....
1
vote
1
answer
71
views
403 Forbidden: "CSRF Failed: CSRF token missing." on DRF api-token-auth/ after applying csrf_exempt
I'm encountering a persistent 403 Forbidden error with the detail:
CSRF Failed: CSRF token missing.
This happens when trying to obtain an authentication token using Django REST Framework's built-in ...
0
votes
0
answers
73
views
'django.db.utils.ProgrammingError: relation "users_user" does not exist' error while running ' python manage.py migrate_schemas --shared'
AccrediDoc - Multi-tenant Accreditation Management System
A comprehensive Django-based multi-tenant accreditation management system designed for healthcare organizations in India. Manage NABL, NABH, ...
2
votes
1
answer
81
views
Django: Annotate queryset based on the existence of many-to-many relationships
I am using Django 5.2 with Postgres 17 and try to modify the queryset of a ListView for row-based access control. Items are to be included in the queryset either if the user is part of a project that ...
-2
votes
1
answer
82
views
Django views spawn the error "cleansed = [self.cleanse_setting("", v) for v in value]" and go in infinite loops
I have two views that spawn these messages in sudo systemctl status gunicorn:
gunicorn:
Nov 07 10:46:36 mysite gunicorn[2107]: cleansed = [self.cleanse_setting("", v) for v in value]
Nov ...
0
votes
0
answers
37
views
appAccountToken not sent to backend during Apple coupon (reward) redemption using StoreKit 2
I'm integrating Apple In-App Purchases with StoreKit 2 in an iOS app.
The backend (Django) handles subscription verification and links each transaction to a user using appAccountToken.
Everything ...
1
vote
2
answers
110
views
Upgrading Django to 5.2.7 causing error wth rest_framework_simplejwt as django.utils.timezone is depreciated
I am upgrading my Django project to v5.2.7.
After installing requirements.txt with the upgraded versions of all libraries, I ran the command to validate the code
python manage.py check
But it is ...
-1
votes
0
answers
49
views
Error running developmental server in Django project some issue with migration
I have developed a project for SASS with django tenate. While migratiing, I got the following error
it seems, like it is related to migration file.
(acc_venv) D:\\workik_projects\\AccrediDoc_v2\>py ...
0
votes
3
answers
75
views
Django static images not showing on Vercel
I'm deploying my Django project to Vercel, and everything works fine locally but after deployment, images from the static folder are not showing.
Project structure:
datafam/
├── settings.py
├── ...
0
votes
1
answer
48
views
"SMTPAuthenticationError: Authentication disabled due to threshold limitation" on production server on AWS
I've set-up email sending in my Django project that is deployed on AWS. When I run it locally the emails go out without a problem, but when I try it on production server on EC2 ubuntu VM, I get ...
2
votes
2
answers
61
views
Django Rest Framework ListAPIView user permissions - Cant seem to get them working
I have a Django project with DjangoRestFramework. I have a simple view, Facility, which is a ListAPIView. Permissions were generated for add, change, delete and view.
I have create a new user, and ...
-2
votes
0
answers
39
views
Django gunicorn gevent with Statsig - run code in forked process
I am running Django app with gunicorn gevent workers. I'm using Statsig for Feature Flagging.
It appears to be struggling, I assume due to gevents monkey patching. I was hoping I could get around this ...
-2
votes
0
answers
99
views
Django unicorn asgi concurrency performan issue [duplicate]
Edit
Here is a similar question but is specifically about request sync block in async.
I'm just curious more about why the concurrency means they all take substantially longer - at different places in ...
0
votes
1
answer
64
views
Create question with options from same endpoint
I am making a back-end system using DRF in Django. This is my first project in Django and DRF. I am using Django purely as a REST back-end
I am making a quiz/mcq application
This is from my questions ...
4
votes
2
answers
112
views
Django difference between aware datetimes across DST [duplicate]
I'm working on a Django application in which I need to calculate the difference between timestamps stored in the DB. This week I run into some problems related to DST.
In particular in the following ...
4
votes
1
answer
103
views
can I use get_or_create() in django to assign a global variable?
I am an intern at a company and we are using django as framework.
I was working on a two part register system in which an admin performs the initial registration after which a link is sent to the user ...
1
vote
0
answers
51
views
Django Celery Beat SQS slow scheduling
Beat seems to be sending the messages into SQS very slowly, about 100/minute.
Every Sunday I have a sendout to about 16k users, and they're all booked for 6.30pm. Beat starts picking it up at the ...
3
votes
1
answer
93
views
Django Mongodb Backend not creating collections and indexes
Summary
Running Django migrations against our MongoDB database does not create MongoDB collections or indexes as defined in our app. The command completes without errors, but no collections or indexes ...
4
votes
1
answer
108
views
How to aggregate hierarchical data efficiently in Django without causing N+1 queries?
I’m working with a hierarchical model structure in Django, where each level can represent a region, district, or village. The structure looks like this:
class Location(models.Model):
name = models....
1
vote
1
answer
148
views
Deploy Django and Nginx under subpath
I'm trying to deploy a Django app with Gunicorn and Nginx under a subpath, I'm inside a corporate network, and the path www.example.com/myapp points to the IP 192.168.192.77:8080 of my PC on the local ...
2
votes
1
answer
91
views
Django transaction.atomic() on single operation prevents race conditions?
Why I need to use atomic() when I have only 1 db operation inside atomic block? My AI-assistant tells me that it prevents race conditions, but I don't use select_for_update() inside. It tells that db ...
0
votes
1
answer
218
views
Can't insert rows into Supabase profile table even after creating the RLS policy to do so for the sign up feature
I am quite new to Supabase.
Basically, I am doing auth using Supabase and have this table called "profiles" with columns:
id - UUID
username - text
email - text
Now when I create a new ...