I'm using Django 5.2 and I can't get my head around the following issue: In my view, I have something like this: removal_qs = request.GET.copy() # contains teams=1&teams=2 removal_qs.setlist('teams', [1]) Debugging shows: In [3]: type(removal_qs) Out[3]: django.http.request.QueryDict But …
Hello I'm on a fullstack course with the Code Instiute and both me and technical support have been stumped on this issiue: After deploying on Heroku no css or js loads or runs. error from chrome inspect console log: turnpenny-fry-syndrome-98cd38841f84.herokuapp.com/:1 …
I'm running a Django application on Google Cloud Run using the default WSGI-based setup (e.g., Gunicorn/ runserver for local dev). To avoid blocking during long-running operations like third-party API calls, I'm planning to use Google Cloud Tasks. Current design: A …
I'm building a multi-platform system where I have one central authentication service (let's call it "Auth") and multiple other Django applications (App1, App2, App3) that need to authenticate users with custom tokens and permissions. Current Setup: Auth service: Handles …
I am using the Django REST Framework with dj-rest-auth and django-allauth for authentication and authorisation with JWTs. From what I have heard, using HTTP-only cookies to store the tokens is a secure approach where the access token is passed in …
Using WeasyPrint but it is always overwhelming me with INFO, DEBUB messages. How do I turn them all off? Nothing i have tried works. (Using Django) Thanks
I have a webapp using django hosted on render cloud platform which allows users to make api call to deepseek. These api calls sometimes take 5 minutes to respond, and doing so with async may cause issues if user connection …
I have a Django project, version - 3.2.25. The problem I'm facing is that I'm unable to create a test database, when I'm executing my tests using VScode test runner. If matters here are the pytest versions: name : …
I created and enabled a tutor plugin successfully using this command cookiecutter https://github.com/overhangio/cookiecutter-tutor-plugin.git How would I use this plugin to implement Admin Action Button: I have a folder adminUser with 2 files …
Needed to make scrollable list of buttons in the left part of the screen. But the scrollbar in child div, even forced by overflow: scroll is not working. Read about removing overflow from parent objects, but without success. Left only …
I'm learning DRF from video, I can't figure out how to get the query parameter from vue.js in django so that the filter works. Github of the project author: Django: https://github.com/SteinOveHelset/djackets_django Vue.js: https://github.com/SteinOveHelset/djackets_vue …
I am attempting to use Django's format_html_join() util to return an html formatted version history for one of my models. But I cannot get format_html_join() to accept my list of dictionaries. Here is what the documentation suggests: format_html_join( "\n", '<li …
I've added HTMX to my Django project, and after that my plotly chart started glitching. I generate HTML for the chart with: def get_chart(f, power, resolution): import pandas as pd yaxis_title = "Power, %" try: df = pd.read_csv( …
Context I have a model: class Article(models.Model): id = models.UUIDField(default=uuid4, editable=False, unique=True, primary_key=True) paper_id: UUID | None paper = models.ForeignKey["Paper"]( "Paper", on_delete=models.CASCADE, related_name="articles", null=True, blank=True, ) website_id: UUID | None website = models.ForeignKey["Website"]( "Website", on_delete=models.CASCADE, related_name="articles", null=True, blank=True, …
I have an AWS Elastic Load Balancer (ELB) and listeners which redirect to port 80 internally (certificates and SSL termination at the ELB). I'm running nginx on the EC2 instances, along with php, gunicorn and django/python. The cluster is being …
Django was working fine my venv got corrupted and I rebuilt it from requirements.txt now getting File "C:\Users\PC\OneDrive\Documents\GitHub\DoseV3Master\venv\Lib\site-packages\msilib_init_.py", line 3, in from _msi import * ModuleNotFoundError: No module named '_msi' went to pypi and got the installer pip install python-msi …
I am using Cursor. I cannot command-click into fixtures injected as parameters in my pytests. Command-clicking to any other variable, function, class works fine. I am working in a Django Ninja project. @pytest.mark.django_db def test_deleting_an_already_inactive_channel_raises_error(mock_auth, client, client_headers, user, …
I’m trying to solve an issue with djangoproject.com. The footer on the bottom right has a “Corporate Membership” link under “Support Us”. The “Corporate Membership” link works when the url is https://www.djangoproject.com/foundation/corporate-membership/%E2%80%9D but not in case of https://docs.djangoproject.com/foundation/corporate-membership/%E2%80%9D or https://dashboard.djangoproject.com/foundation/corporate-membership/%E2%80%9D. …
I’m working on a Django-based app where developers can connect users to their apps using an account number. Once connected, a Subscription model is created with fields like user, plan, is_active, and next_billing_date. The next_billing_date depends on the plan type …
I’m using Django and PostgreSQL for my web project, which I’ve containerized using Docker. I run it on a VPS and serve it with Nginx (running outside Docker). I'm concerned about the security of my PostgreSQL database and want to …
I have a Book model that has a authors field which is a ManyToMany field to Author model. I'm using django-autocomplete-light package to render a select2 widget in my templates that will allow me to select more than one author …
I can not get Uppy AWS to work. I am using DigitalOcean Storage. Here is the HTML (part is GitHub Copilot): <div id="uppy"></div> <script type="module"> import {Uppy, Dashboard, AwsS3} from "https://releases.transloadit.com/uppy/v4.13.3/uppy.min.mjs" const uppy = new Uppy() uppy.use(Dashboard, …
Working on a Django project deployed on AWS. In production, I'm facing a session-related issue: When I open the Django admin site (/admin) and log in, everything works smoothly. But if I open the user site (/) in the same …
I've got some long-standing code in a Django code base that reads in a PDF and uses Wand to take a screenshot of the first page of the PDF, which is then displayed on the website. We …
I'm using Django's template inheritance (extends) in every page of the app. The current design looks too zoomed out, and I want to adjust the default scaling through my index.html, but it didn't work. I also tried using custom CSS, …
The PostgreSQL specific model fields docs are very specific about how to compare one RangeField to another range. But how do you compare a range to a single point? For example, if I've got a model with …
Summary of Issue: 502 Bad Gateway from ELB to Django app behind Nginx + Gunicorn on EC2 Environment: Hi, I wonder if anyone can assist. I've been banging my head against a wall for over a week now, I've tried …
Test yields TypeError: test() missing 1 required positional argument: 'fix' from django.test import TestCase import pytest @pytest.fixture def fix(): return "x" class QueryTestCase(TestCase): def test(self, fix): print(fix) An almost similar case exists but I want the …
Imagine i have a "first.py" file with some code in it , and then i import it in another python file called "secend.py" then i import the "secend.py" file & "first.py" into "third.py" file ,, Will this cause any …
I am getting the following output in my warnings summary: venv/lib/python3.11/site-packages/pydantic/_internal/_config.py:323: 15 warnings /Users/darshankalola/Desktop/roon-be/roon-doctor-service/.venv/lib/python3.11/site-packages/pydantic/_internal/_config.py:323: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.11/migration/ …
I am having some issues with the latest version of Django. It seems they have removed the --skip-checks option from the manage.py migrate command. The problem I am getting is that the app (that was working on 4.2) is trying …
I'm using the below to render model initial counts on load. consumers.py: from channels.generic.websocket import WebsocketConsumer from django.template.loader import render_to_string from myapp.models import Model1, Model2, Model3, Model4 class DashboardHeaderConsumer(WebsocketConsumer): def update_dashboard_counts(self): stats = [ {'name': 'Model1', 'value': Model1.objects.count()}, {'name': 'Model2', …
I'm trying to deploy a Django application with compiled Tailwind CSS to Railway, but I keep getting Procfile parsing errors. The build process works fine (Tailwind compiles successfully), but the deployment fails during the Procfile parsing stage. Error Message Nixpacks …
I'm building a Todo app with Django and JavaScript. I've reached the point where when I click a "trash" button, the note should be deleted, but it shows an error in the console, the reason for which is not clear …
When I run python manage.py makemigrations, it just gets stuck. No matter how long I wait, it stays frozen forever—no logs, no output, nothing. I even changed my PostgreSQL database to the default SQLite database in settings.py, but it still …
Let's take some Store and Book models as examples: class Book(Model): title = CharField(...) ... class Store(Model): books = ManyToManyField('Book', blank=True, related_name='stores') .... I receive a list of book titles and must return stores linked to those books. I …
The problem occurs when I delete the db.sqlite3 and media on .gitignore file. and write add command git add -A. the error comes fatal:adding files fail PS C:\Users\user\OneDrive - Education Department, Government of Punjab\Desktop\Django demos\Blog> git add -A error: read …
Describe the Problem I have a ModelViewSet in Django REST Framework designed to return a list of Order objects. To improve performance, I'm trying to implement custom pagination that limits the results to 65 per page. Despite setting the pagination_class …
This is the part of the code in the Django + JavaScript Todo App that is responsible for deleting a note. I need a csrftoken for this, but the JS is showing me an error in the console. What did …
Imagine i have a super simple serializer.py file : and i just want to use it ! nothing special .. so im going to write something like this (with …