I'm building a marketplace app (think classified ads with negotiations) and trying to implement a personalized recommendation feed. I have a hybrid architecture question about the best way to handle this: Current Setup: Django backend with PostgreSQL for product …
I am new to django and currently learning and i have encountered a problem that i just cant seem to solve. from django.shortcuts import render, redirect from django.contrib import messages from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm from django.contrib.auth.decorators import login_required …
I'm building a Django web app where users can upload images to detect objects using a YOLO ensemble model saved as a .pt file. This model includes keys like 'model', 'names', 'stride', and 'ensemble_info'. So far, I can load the …
I’m implementing payments with Stripe and I’ve run into a flow I don’t know how to solve. I’d like to know the right or recommended way. Scenario First payment with UI: The user goes to my frontend, I use …
I have created a StreamField for some of the site's settings. This StreamField contains a collection of a custom StructBlock, named FacetBlock. FacetBlock contains a BooleanBlock, a CharBlock, an IntegerBlock and a ChoiceBlock. Now I need to make the CharBlock …
I have a model Table which gets a new entry every few seconds, so it's a quite big table. class Table(models.Model): id: int pk: int timestamp = models.PositiveBigIntegerField(db_index=True) Now what i am trying to do is get …
I've been trying to implement the paginator function for about two months now. I've tried many different approaches, but they always lead to new bugs. In views.py, I load the posts and send them to JavaScript. In loadPosts and loadProfile, …
We are seeing a ~6-second delay when a Celery task is triggered via the Django UI (e.g., my_task.delay()). Our stack runs on Kubernetes, and I'm wondering if this lag is due to resource constraints or something else. Key Services and …
I'm hosting a Django project on a shared server using cPanel, and I’ve been running into a frustrating issue lately. On several pages across the site, I get a 500 Internal Server Error. After checking Sentry, I consistently see this …
I would like to be able to restart the manage.py runserver Django command using a signal (like in kill -HUP PID). Does Django even support this? SIGHUP, SIGINT, SIGTERM just exit the process. Tried pkill -HUP, didn't work.
I have a Django project running locally, with its database as MariaDB 10.6 running in a Docker container. The Django tests work fine, but when I try to run them with a --parallel flag I get an error "FileNotFoundError: [Errno …
I want to adjust pg_trgm.similarity_threshold on some of my queries. But since I'm using PgBouncer (in transaction pooling mode) to mediate access to my Postgres database, I want to be sure that when I'm done, the session value is set …
This one for python wizards. I got next code in some of my messenger class: response: Dict[str, Any] | None = None try: response = self.client.post("url/", data=payload) if not response or not response.get("ok"): logger.warning( "[MessageService sync_chat] " …
I'm losing my mind here. Been working on this e-commerce site for months and suddenly the product catalog page takes 3+ seconds to load. The Django ORM is generating absolutely bonkers SQL with nested subqueries everywhere instead of simple JOINs. …
This is what im building I am currently developing a receipt system and when i run the application, i get this error, i have checked the settings.py and my app has been added to the list of installed apps, my …
I'm implementing OTP verification for user signup/login in my application and I need a reliable SMS service provider. My main goals are: Global Reach – The service should support sending SMS OTPs to users in multiple countries. OTP Verification – …
When deploying an Django full stack app on GoDaddy VPS I came across this error, I have also changed server the the error still persists, my application use Celery for email tasks queues with Redis, I do not know what …
I have a Django admin page which allows me to edit a model in my domain. The ModelAdmin looks like this: @admin.register(models.VehicleTemplate) class VehicleTemplateAdmin(ModelAdminBase): list_reverse_relation_inline = False search_fields = ["name", "description"] list_display = ["name", "description", "parent", "status"] inlines = [VehicleInline] …
I am using django-allauth in my project and I have configured Google as a SocialAuth provider. I have a custom signal receiver that updates the phone number on the SocialAuthAccount after the user signs up. But currently the system throws …
I'm getting the following error when I try to run my Django project: decouple.UndefinedValueError: SECRET_KEY not found. I'm using python-decouple to manage environment variables. In my settings.py, I have: from decouple import config SECRET_KEY = …
Всем привет! Разрабатываю сайт на Django/React с хранением файлов в S3 хранилище от Selectel, весь проект разворачиваю в Docker. У меня возник вопрос касаемо того как проверять загружаемые файлы в S3 на безопасность. Вижу три основных пути реализации механизма, но …
As part of our project, we made some changes, merged the PRs, and deployed the latest code to our development server. However, after deploying, we noticed that Django is generating new migrations, even though there were no changes made to …
I want to test emails from django app, i was using mailtrap before but now i want to test my emails locally. For Django developers, transitioning from a remote email testing service like Mailtrap to a local solution is often …
Django 5.2 introduced the ability to customize the shell management command by overriding the get_auto_imports() method in a management command subclass (see the release note or this page of the doc). That's a nice …
I am trying to run Selenium tests for a Django app on CircleCI. The browser tools are updated 28.05.2025, but I still can't manage to configure it... In my config.yml I have version: 2.1 orbs: python: circleci/python@3.1.0 slack: circleci/slack@4.10.1 browser-tools: …
I am ahving a problem. I am following a tutorial and wrote a wait for db command in my django project to wait until db is available and then run my tests. The command is below: docker compose run --rm …
Модель: class Access(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) ... class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) full_name = models.CharField(max_length=300, blank=True) В админке Django в таблице Access столбец user - отображает username пользователя. Вопрос в том, можно ли изменить значения в этом …
In href tag I want to send product id but this code showing an error. Could not parse the remainder: 'data.id' from ''viewproduct'data.id' {% for data in data %} <div class="item mt-5"> <div class="card" > **<a href={% url 'viewproduct'data.id …
I'm a computer science student currently learning web development and just getting started with Python. I've covered some basics like variables, data types, and simple loops, but I'm not sure what to focus on next or how to build a …
Im currently working on a news project which i have news-writer , article-writer etc . im using proxy models , i created a base User model and i created more user models in the name of NewsWritetUser and it has …
I'm running a Django application that uses Celery tasks and PySpark inside a Docker container. One of my Celery tasks calls a function that initializes a SparkSession using getOrCreate(). However, when this happens, the worker exits unexpectedly with a SystemExit: …
In django python, I am able to overwrite the save_related function (when save_as = True) so the instance I am trying to copy is saved and copied properly. When I save, though, I want other objects in other tables linked …
After a lot of trouble I finally got a Django writable nested model serializer working using drf-writable-nested, for nested data with a reverse foreign key relationship. Currently this requires me to copy and manually parse request.data for all fields to …
Models and template codes are here: models.py from django.db import models from meta.models import ModelMeta ... class Tool(ModelMeta,models.Model): title = models.CharField(max_length = 250,help_text='Title') photo = ResizedImageField(size=[250, 225]) description = RichTextUploadingField(blank=True) _metadata = { 'title': 'get_title', 'description': 'get_description', 'image': 'get_image', } …
I'm an intern trying to deploy a Django application on a cPanel server, and I've run into a persistent "Internal Server Error" coupled with an Apache redirect loop. I've been troubleshooting for over two days with various AI helpers, but …
I am working on a tutorial project. The same code works for the instructor but doesn't work for me. I have a file for custom commands: import time from psycopg2 import OperationalError as Psycopg2OpError from django.db.utils import OperationalError from django.core.management.base …
I have implemented a speech to text translation in my django-react project. I am capturing the audio using the Web Audio API, ie, using navigator.mediaDevices.getUserMedia to access the microphone, AudioContext to create a processing pipeline, MediaStreamAudioSourceNode to input the audio …
In Unfold admin, the changelist table switches to a stacked layout on small screens — likely due to Tailwind classes like block and lg:table. I’d like to change the breakpoint at which this layout switch happens (for example, use md …
How can I actively engage with the Django community? Looking for forums, Discord/Slack groups, or events to discuss best practices, ask questions, and contribute. Any recommendations? I want to connect with the Django community for learning and collaboration. I checked …
Django 5.1 introduced the LoginRequiredMiddleware. This comes with the companion decorator login_not_required() for function-based views that don't need authentication. What do I do for a class-based view that doesn't need authentication?