I'm currently testing pghistory for our Django project. I set up a few models to be tracked. As a convention our model names are different from the actual table names - these are defined in the Meta class like so: …
I'm writing a testcase to reproduce deadlock in my service. After I use multiprocessing to create a two thread, I found they use the same database connection. So I can't reproduce the deadlock scenario in testcase. How do i resolve …
I am working on a Django project and using uv as the package manager. My dependencies are managed in pyproject.toml, and I have the following setup: pyproject.toml (Relevant Parts) [project] name = "port-backend" version = "0.1.0" description = "Backend service …
Using easy-thumbnails package. Getting the error for the template file below. Cant seem to figure out what the syntax issue is. i.image is of type ImageFileField **Could not parse the remainder: ' i.image 320x260' from 'thumbnail i.image 320x260' ** …
I am trying to host the Django backend of my website on railway, however when I try and deploy the server, I get: /bin/bash: line 1: gunicorn: command not found error in logs I've followed all the steps of creating …
I'm building a Django web app to manage item stock, where authenticated users can "take" items from inventory (I'm not using djangos authentication system, is more like the user enters a code and the app checks in SQL Server if …
I have a server on AWS EC2 with port 8001 open with a websocket application. The application itself is written in Django Channels and uses a daphne server. The problem is that I myself can connect to the websocket server, …
I'm new with python, I'm trying to parse api request to a defined model, so how to fix below code? class PersonSerializer(serializers.Serializer): name = serializers.CharField() class APIJustTest(APIView): parser_classes = (JSONParser,) @swagger_auto_schema(request_body=PersonSerializer) def post(self, request, *args, **krgs): serializer = PersonSerializer(data=request.data) serializer.is_valid() …
I'm making a project using the Django framework and is creating a website and is encountering this error: Cannot assign "<User: >": "Booking.teacher" must be a "User" instance. this is my model for User: class User(AbstractUser): groups = …
I have 2 lists (if that is what django calls them) containg an id and a key/value pair e.g. [{'id': x, 'string': 'string'}] one list assigned to variable 'periods' the other assigned to 'paydates'. I am trying to loop through …
We are developing react native app with django as a backend. We deployed django on VM(which we bought it has Window OS) and there git pulled and running django server by just uvicorn backend.asgi:application --host 0.0.0.0 --port 8000, we want …
Class Company_Car(models.Model): @property def days_left(self): print("RUNNED PROPERTY") if self.date_valid is not None and self.date_valid >= datetime.datetime.now().date(): return (self.date_valid - datetime.datetime.now().date()).days added = models.DateTimeField(auto_now_add=True) status = models.BooleanField(default=True) company = models.ForeignKey(Company, on_delete=models.DO_NOTHING) date_valid = models.DateField(null=True, blank=True) Each time when i ask …
I am working on an e-commerce project where a product has multiple variations (like different colors, sizes, etc.), and each variation has its own stock. When a user selects a variation, I want to update the displayed stock dynamically, but …
I can't find a way to serve our large Django application using all three of preload, ASGI, and SO_REUSEPORT. Without preload and fork we use much more memory (gigabytes). Without ASGI we can't serve websockets (and starting another server just …
I have a React application that I need to deploy, and I am considering two options for serving the production build: 1. Serving the React build directly with Django (e.g., using WhiteNoise or serving it as static files). 2. Using …
The problem is that i dont see any print or log messages in my views.py , which made me to a conclusion that that method is not method is not being called. What i want to is to cancel subscription …
In my django project, the models Form, FormSubmission, CmsEvent are in a postgres database and the models CmsEventOrder, CmsEventPayment are in another postgres database. When I makemigrations, the migrations is created for all the models, while it should only be …
I am developing an android app in Kotlin and trying to make a request to my local Django server but getting this error. The local server is launched on IP and port 127.0.0.1:8000 and I specified in my android application …
I have a wagtail site and I want to create an object hierarchy in a one-to-one matter, but with multiple options. Basically, I want that the database setup look slike this: CREATE TABLE products ( id PRIMARY KEY, product_type VARCHAR(10) …
I am trying to integrate Microsoft authentication with my Django app using the django_auth_adfs package. However, I encountered an error regarding a mismatch in the redirect URI. I have followed the documentation provided by django_auth_adfs for configuring …
I'm developing a small project using Django v5 and Bootstrap v5. At this stage I'm just playing around with the registration and login pages but I'd like to style the form using crispy-form and the crispy FormHelper. I can change …
I'm trying to implement email-based authentication in Django instead of using the default username. I’ve updated my User model and authentication backend, but I’m still unable to authenticate users with their email addresses. views.py from django.shortcuts import render,HttpResponseRedirect from .forms …
Необходимо что бы во вкладке отображались данные по направлениям при написании {% if n.route == "ЦДНГ-2,ДНС-1,ЦДНГ-1,ДНС-1" %} условие не выполняется что я делаю не так <div class="panel_data"> <div class="tab"> {% …
I have a Django model Player. Now this model has a save method which goes like this: def save(self, *args, **kwargs): """ Overrides the save method to convert the 'name' attribute to uppercase before saving. """ player = Player.objects.filter( Q(fide_id=self.fide_id, …
So I've spent days searching on and off for an answer to this question, and much to my surprise, I can't seem to find anbyone asking this specific question, nor any mentions of the confusion I have around it. My …
Is there a way to inject a class into the <code> tag produced by wagtail-markdown so that I can style my Markdown code blocks with Prism instead of Pygments, which is …
In the UniqueConstraint for personality -> language, I'm getting the error FieldDoesNotExist For example, if my code looked like this: class LanguageModel(models.Model): language = models.CharField( max_length=16, default="en", ) class Meta: abstract = True class PersonModel(LanguageModel): created_at = models.DateTimeField(editable=False, …
This error keeps appearing, even though I have the add_user app installed in my directory and registered in the settings.py file.
I have a docker compose Django project that runs fine in a terminal on the server and I'm trying to set up PyCharm for development debugging. In my docker-compose.py I have a volume mapping the project root on the host …
I'm using Django Ninja Extra to write an API controller. Here is my code: @api_controller('', tags=['User'], auth=NOT_SET, permissions=[]) class User: @http_get('/user/colls', response=List[schemas.UserCollsOut], auth=JWTAuth()) @paginate(PageNumberPagination, page_size=10) def get_user_colls(self, request): data = userModels.UserCollection.objects.filter(user=request.auth) return data When I run this code, I …
I had my project set up on my local computer, and in the beginning, everything was working file. for past couple of days. my django ORM is not working properly it showing failed SQL error <img src="https://i.sstatic.net/pBiQAp4f.png" …
The file /var/log/nginx/error.log contains errors of the following type: [error] 714#714: *5 open() "/home/<user>/<projects>/static/css/custom.css" failed (13: Permission denied), client: ip, server: domain, request: "GET /static/css/custom.css HTTP/1.1", host: "domain", referrer: "http://domain/" The following settings are specified in the /etc/nginx/sites-available/<project> file: …
В файле /var/log/nginx/error.log ошибки следующего типа: [error] 714#714: *5 open() "/home/<user>/<projects>/static/css/custom.css" failed (13: Permission denied), client: ip, server: domain, request: "GET /static/css/custom.css HTTP/1.1", host: "domain", referrer: "http://domain/" В файле /etc/nginx/sites-available/<project> указаны следующие настройки: server { listen 80; server_name <domain>; …
I am making a documentation site to self-host for myself; learning Django at the same time. I am at the point where I am starting to populate the website. I am wondering if there is a possibility to have two …
How can I develop software that allows me to send bulk messages to customers via WhatsApp by importing a CSV file, using the official WhatsApp API, ensuring that my account remains active and does not get blocked? I need guidance …
Please elaborate it I tried learning it with some tutorials of youtube, but not clear like its enough or not. I currently worked on shells, migrations, authentication and everything I need to do. I wanna land a good job as …
I currently have a system where devices can be created and managed through the Device model directly. However, I want to change it so that devices can only be added or deleted through the Client model, and not directly through …
I built web with django, and hosted it in heroku. Now I am working for a bank and going to build dashboard, but I can not host it on heroku. It should be in the local server only as far …
Working in Django, I am trying to update the items of a database through submitting a form. I need a confirmation dialog before submission. These are my lines on related code: $(document).ready(function(){ setInterval(function(){ $.ajax({ type: 'GET', url: 'http://127.0.0.1:8000/update_in_line_orders', success: function(response){ …
I am working on a webapp with django backend. It is related to image generation with character consistency, we finally have a model that works well for that, gemini 2.0 flash experimental. I am generating a character with openAI and …