311,585 questions
-1
votes
0
answers
33
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 ...
Advice
0
votes
1
replies
41
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 ...
-3
votes
0
answers
37
views
Django Strategies for processing large datasets from an external API without a local replica table [closed]
I am building an SMS gateway system in Django that acts as an interface between university data sources (e.g., student information systems) and an SMS provider.
The Architecture: To ensure data ...
2
votes
1
answer
43
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 ...
0
votes
0
answers
85
views
Django channels tutorial issue
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 ...
-3
votes
2
answers
86
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.
1
vote
1
answer
59
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 ...
-3
votes
0
answers
39
views
How to persist multi-step form data between views in Django without committing to DB? [closed]
One-line project/context.
Short description of the problem and constraints.
Minimal code: models, the two views, form classes, snippets of urls.py.
Exact observed behavior or error.
Alternatives ...
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 ...
1
vote
2
answers
85
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 ...
0
votes
1
answer
31
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
69
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
46
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....
0
votes
0
answers
69
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
78
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 ...
1
vote
2
answers
104
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 ...
0
votes
3
answers
72
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
├── ...
2
votes
2
answers
49
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 ...
-1
votes
0
answers
75
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 ...
4
votes
2
answers
108
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 ...
1
vote
0
answers
49
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 ...
4
votes
1
answer
102
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....
2
votes
1
answer
88
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
200
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 ...
1
vote
2
answers
93
views
How to reuse a Django model for multiple relationships
I want to make a task model and a user model. And I want each task to be able to be related to 3 users. Each task should be related to a creator user, an assignee user, and a verifier user. And I want ...