Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Why does my uwsgi app respond with prematurely closed connection?
I can serve my django app running uwsgi --socket lhhs/lhhs.sock --module lhhs/lhhs.wsgi --chmod-socket=664 And the django app runs quick and running python manage.py test shows it is fine. But uisng nginx and uwsgi-emperor I get upstream prematurely closed connection while reading response header from upstream, client: 74.45.12.120, server: lhhs.oh-joy.org, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///var/www/webapps/lhhs/lhhs/lhhs.sock:", host: "lhhs.oh-joy.org" Here is my .ini file: uid = www-data chdir=/var/www/webapps/lhhs/lhhs home=/var/www/webapps/lhhs/env home=/var/www/webapps/lhhs/env module=lhhs.wsgi:application master=True pidfile=/tmp/project-master.pid vacuum=True max-requests=5000 daemonize=/var/www/webapps/lhhs/log/lhhs-uwsgi.log socket=/var/www/webapps/lhhs/lhhs/lhhs.sock chmod-socket = 664 Here is my nginx config: upstream django { server unix:///var/www/webapps/lhhs/lhhs/lhhs.sock; # for a file socket #server 127.0.0.1:8001; # for a web port socket (we'll use this first) } server { listen 443 ssl; server_name lhhs.oh-joy.org; charset utf-8; ssl_certificate /etc/letsencrypt/live/lhhs.oh-joy.org/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/lhhs.oh-joy.org/privkey.pem; # managed by Certbot location /static { alias /var/www/webapps/lhhs/lhhs/static; } location /media { alias /var/www/webapps/lhhs/lhhs/media; } location /favicon.ico { alias /var/www/webapps/lhhs/lhhs/static/images/favicon.ico; } location / { include /etc/nginx/uwsgi_params; uwsgi_pass django; } } server { if ($host = lhhs.oh-joy.org) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; server_name lhhs.oh-joy.org; return 404; # managed by Certbot } -
Django/CKEditor - config for extraProviders
How can I configure a simple extraProvider for local media in my CKEDITOR_5_CONFIGS in the settings.py file? I tested the configuration below via javascript and it worked fine, but when I switched to python, I got the error Uncaught CKEditorError: this._previewRenderer is not a function. I'm almost giving up and moving on to another alternative, such as directly editing the app.js file of the django-ckedtor-5 library. Any suggestions? CKEDITOR_5_CONFIGS = { ... 'mediaEmbed': { 'previewsInData': True, 'extraProviders': [ { 'name': 'LocalProvider', 'url': '/^https?:\/\/[^\/]+\/media\/videos\/(.+\.(mp4|avi|mov|webm|ogg|mkv))$/', 'html': 'match => `<video width="640" height="360" controls><source src="${match[0]}" type="video/${match[2]}">Seu navegador não suporta vídeo.</video>`' }, ] } } -
I can't solve the migration problem in django
I put the oracle db that I was currently developing with django and oracle into the db that impdp and distributed it. However, the distribution db has a different schema name from the development db, so it is not possible to properly migrate. Also, because I impdp, tables such as django migrations have also been handed over to the distribution db. How can I do the migration properly here? Also I want to impdp varoown/varoown99@varo directory=dump dumpfile=varolig_dump4.dmp remap_schema=varo:varoown transform=segment_attributes:n logfile=import.log I did an impdp with the following command And when I checked with python manage.py dbshell, I also checked that db is properly connected -
Deploy logs "--error-logfile/--log-file" railway with django
I'm deploying my django app for the very first time on railway. On railways in the project deployment details I see: enter image description here However when I go in the deploy logs I see this error "gunicorn: error: argument --error-logfile/--log-file: expected one argument usage: gunicorn [OPTIONS] [APP_MODULE]" : enter image description here It seems that the issue comes from the Procfile: My ProcFile contains: web: gunicorn telecom_tracker.telco_tracker.wsgi I tried several alternative but still get the same issue. My project follows the following structure: enter image description here Any idea what could be the bug root ? thanks in advance !! -
Error when applying migrations 'no password supplied', but I can connect to the database from the interpreter
I decided to revive my pet project that I wrote 2 years ago. First I had to update all dependencies, this is ok. But migrations are not performed when working with a local server. The pg_hba.conf file has md5. At the same time, if I connect to the DB from the interpreter via psycopg2, everything works fine. This is what traceback shows enter image description here enter image description here I would like to quickly figure this out, so I am writing here, maybe someone has encountered this and can help right away. If not, I will, of course, dig into the modules from the traceback. Thanks in advance for your answer! -
Is there a way to define an authentication for webhooks in DRF Specacular
I have the following webhook definition change_event_webhook = OpenApiWebhook( name="AddonWebhook", decorator=extend_schema( summary="A Webhook event", description="Pushes events to a notification URL. ", tags=["webhooks"], request={"application/json": load_schema("myschema.json")}, responses={ "2XX": OpenApiResponse("Event was received successfully"), }, ), ) which produces the following schema ... webhooks: AddonWebhook: post: description: 'Pushes events to a notification URL. ' summary: A Webhook event for an addon tags: - webhooks requestBody: content: application/json: schema: $id: https://my-schema.url/schema.json $schema: http://json-schema.org/draft-07/schema# title: Webhooks messaging additionalProperties: false definitions: {} type: object required: - change_id - action properties: change_id: title: Change ID type: integer description: Numerical ID of change action: title: Change Action type: string description: Verbose name of the change responses: 2XX: content: application/json: schema: type: object additionalProperties: {} description: Unspecified response body description: '' My redocly rules sets the security as required, so when linting my schema, I get the following error "Every operation should have security defined on it or on the root level." How can I add an authentication method (lik HMAC) to my webhook definition ? The desired result would then include something like security: - signatureAuth: [] -
How to Automatically Copy Product Attributes to Variants in Django Models?
I am building an e-commerce website in Django where: A Product can have multiple variants. Each product has attributes (e.g., color, storage, display size). I want each variant to automatically inherit all attributes from the main product when it is created. Models (models.py) from django.db import models class Product(models.Model): name = models.CharField(max_length=255) class ProductVariant(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE, related_name="variants") name = models.CharField(max_length=255) # Example: "Iphone 16 Black 128GB" class ProductAttribute(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE, related_name="attributes") attribute_name = models.CharField(max_length=255) attribute_value = models.TextField() What I Want to Achieve: When a ProductVariant is created, it should automatically copy all attributes from its main product. What is the best way to do this in Django? I want a clean and efficient solution that works well even if I have many variants. Any guidance would be appreciated. Thank you! -
Programmin Error at Routes , i am not getting why is the happening , please help me?
ProgrammingError at /routes/ column airline_app_route.route_id does not exist LINE 1: SELECT "airline_app_route"."route_id", "airline_app_route"."... ^ Request Method: GET Request URL: http://127.0.0.1:8000/routes/ Django Version: 5.1.7 Exception Type: ProgrammingError Exception Value: column airline_app_route.route_id does not exist LINE 1: SELECT "airline_app_route"."route_id", "airline_app_route"."... ^ Exception Location: D:\DEVELOPMENT\VIR_ENV\Lib\site-packages\django\db\backends\utils.py, line 105, in _execute Raised during: airline_app.views.route_list Python Executable: D:\DEVELOPMENT\VIR_ENV\Scripts\python.exe Python Version: 3.13.1 Python Path: ['D:\DEVELOPMENT\airline_reservation', 'D:\Python\python313.zip', 'D:\Python\DLLs', 'D:\Python\Lib', 'D:\Python', 'D:\DEVELOPMENT\VIR_ENV', 'D:\DEVELOPMENT\VIR_ENV\Lib\site-packages'] Server time: Wed, 19 Mar 2025 07:02:57 +0000 -
How to cache python pip requirements of docker build progress?
I'm on a very slow internet connection, and the RUN pip install -r requirements.txt step of docker compose up --build keeps timing out halfway through. When I run docker compose up --build again, it looks like it restarts from the very beginning. All of the python packages get downloaded from scratch. How can I make docker use the downloaded packages from the previous attempt? -
Django + Next cookies not being set when app is hosted
I have a Django app hosted on Google Cloud Run that upon logging in, sets a sessionid and csrftoken in the browser cookies. In my frontend Next app, which I am currently running locally, I redirect to an authenticated page after successful login. However, the cookies are not being set correctly after the redirect, they are empty. After making the login call I can see the cookies in the Application DevTools console, but when I refresh or redirect they are empty. It works when running my Django app locally, but not when it is hosted on Cloud Run. These are my cookie settings in my Django settings.py: SESSION_COOKIE_SAMESITE = 'None' CSRF_COOKIE_SAMESITE = 'None' SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True CSRF_COOKIE_HTTPONLY = False CORS_ALLOW_CREDENTIALS = True My CORS_ALLOWED_ORIGINS and CSRF_TRUSTED_ORIGINS includes my local Next app: http://localhost:3000. I had this working and I am not sure what changed and it is suddenly not. Any help with this would be greatly appreciated! -
Django Docker container unable to connect to Supabase PostgreSQL: Network is unreachable
I'm working on a Django project with Docker, and I'm trying to connect to a Supabase PostgreSQL database. On my local machine, I can connect to the database using the psql command, but when I try to connect from inside the Docker container, I get the following error: connection to server at "db.*********.supabase.co" (2a05:d012:42e:5700:63e9:906e:3eeb:5874), port 5432 failed: Network is unreachable Is the server running on that host and accepting TCP/IP connections? Request Method: POST Request URL: http://13.60.86.154:8000/api/user/register/ Django Version: 4.2.20 Exception Type: OperationalError Exception Value: connection to server at "db.*********.supabase.co" (2a05:d012:42e:5700:63e9:906e:3eeb:5874), port 5432 failed: Network is unreachable Is the server running on that host and accepting TCP/IP connections?``` What I’ve tried: I can connect to the database from my local machine using psql, but not from within the Docker container. The Docker container is running and listening on ports 8000 (backend) and 3000 (frontend) with docker-compose. The error indicates that the connection is being refused because of a "network unreachable" issue. I’ve checked if Docker containers are using IPv6 (the IP shown is an IPv6 address), but the issue persists. What could be causing this issue? How can I resolve it? -
How to specify the port of vscode debugger on a Django docker container?
I have a Django application inside a Docker container. I've configured the launch.json and tasks.json files to run my docker-compose file when the debugger runs: launch.json { "version": "0.2.0", "configurations": [ { "name": "Docker: Python - Django", "type": "docker", "request": "launch", "preLaunchTask": "docker-run: debug", "python": { "pathMappings": [ { "localRoot": "${workspaceFolder}/src", "remoteRoot": "/app/src" } ], "projectType": "django", "port": 8000, } } ] } tasks.json { "version": "2.0.0", "tasks": [ { "type": "docker-build", "label": "docker-build", "platform": "python", "dockerBuild": { "tag": "vscodedjangodocker:latest", "dockerfile": "${workspaceFolder}/Dockerfile", "context": "${workspaceFolder}", "pull": true } }, { "type": "docker-run", "label": "docker-run: debug", "dependsOn": [ "docker-build" ], "python": { "args": [ "runserver", "0.0.0.0:8000", "--nothreading", "--noreload" ], "file": "manage.py" } } ] } docker-compose.yaml version: '3.8' # Specify the version at the top services: backend: build: context: . dockerfile: ./Dockerfile container_name: backend command: python manage.py runserver 0.0.0.0:8000 ports: - 8000:8000 volumes: - .:/app Dockerfile FROM python:3.12-bullseye WORKDIR /app/src/ COPY ./src/requirements.txt . RUN pip install --prefer-binary -r requirements.txt COPY ./src /app/src EXPOSE 8000 CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] The issue I'm facing is that I want the debugger session to run on port 8000 on my local machine, but each time I run the debugger the port that opens is 5500X … -
Should I learn Django first or understand web concepts like databases, APIs, and HTTP first?
I'm new to Django, and I'm currently learning from the official tutorial in the documentation. While going through it, I’ve noticed that many web-related concepts—such as databases, APIs, HTTP, and other web technologies—are mentioned frequently. I have a general understanding of these topics, but I don't fully grasp them yet. Despite this, I feel like I'm making decent progress with Django so far. So, should I continue learning Django and pick up these concepts along the way? Or should I take a step back and learn the fundamentals of web development first before diving deeper into Django? -
Yarn build not generating index.html during Docker build, but works manually in container (Nginx, React, Gunicorn, Django)
I'm trying to set up a website with Nginx, React, Gunicorn, and Django using Docker. Everything works fine except for one issue: When I build the Docker container, the yarn build command doesn't generate the index.html file inside the container. However, when I run the yarn build command manually inside the container, it works, and the index.html file appears in the /app/build folder. Oh, I found that Build dir not have index.html from having 500 error on web and this error in enginx logs : [error] 29#29: *1 rewrite or internal redirection cycle while internally redirecting to "/index.html"... Here is my docker-compose.yml: services: db: image: mysql:8.0 ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} volumes: - db_data:/var/lib/mysql networks: - app-network backend: build: ./backend command: gunicorn aware.wsgi:application --bind 0.0.0.0:8000 volumes: - ./backend:/app depends_on: - db environment: - DJANGO_SETTINGS_MODULE=aware.settings - MYSQL_DATABASE=${MYSQL_DATABASE} - MYSQL_USER=${MYSQL_USER} - MYSQL_PASSWORD=${MYSQL_PASSWORD} - DB_HOST=${DB_HOST} - DB_PORT=${DB_PORT} networks: - app-network frontend: build: ./frontend/front volumes: - ./frontend/front:/app - ./frontend/front/build:/app/build networks: - "app-network" nginx: image: nginx:latest ports: - "80:80" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./frontend/front/build:/app/frontend/front/build - ./frontend/front/build/static:/app/frontend/front/build/static - ./backend/media:/app/backend/media - ./frontend/front/build/favicon.ico:/app/frontend/front/build/favicon.ico depends_on: - backend - frontend networks: - app-network volumes: db_data: networks: app-network: driver: bridge Here is my nginx.config … -
How to Order Queryset by EAV Attribute in Django Using django-filters?
I'm working on a Django project where I'm using an EAV (Entity-Attribute-Value) model to store dynamic attributes for my Product model. I need to allow users to filter and order products by price, which is stored as an EAV attribute (slug='price'). My Setup: I’m using django-filters for filtering. Price is stored in the Value model (part of Django EAV). I'm using a Subquery annotation to retrieve the price from Value. Ordering by price is not working correctly. class BaseInFilterWidget(django_filters.widgets.SuffixedMultiWidget): suffixes = ['choice'] def __init__(self, *args, **kwargs): widgets = [forms.SelectMultiple,] super().__init__(widgets, *args, **kwargs) def value_from_datadict(self, data, files, name): """ Override this method to properly extract the value from the request. """ # Since the key ends with '_choices', we need to handle it here. name_choices = f"{name}_choice" return data.getlist(name_choices) class ProductFilter(django_filters.FilterSet): class Meta: model=product.Product fields=[] def __init__(self, *args, **kwargs): super(ProductFilter, self).__init__(*args, **kwargs) multiple_choice = False for slug in self.data: if slug in ['category', 'location', 'order_by']: if slug == 'category': self.filters[slug] = django_filters.ModelChoiceFilter( field_name='category', queryset=Category.objects.all(), label='Category', to_field_name='slug' ) elif slug == 'location': self.filters[slug] = django_filters.ModelChoiceFilter( field_name='location', queryset=Location.objects.all(), label='Location', to_field_name='slug' ) elif slug == 'order_by': self.filters[slug] = django_filters.OrderingFilter( fields=( ("created", "created"), ("price", "price") ), field_labels={ 'price': 'price Added', }, label='Sort by' ) continue … -
django-allauth stuck on signup and headless=True confusion
I'm trying to setup django-allauth app to be used for authentication by a front end react app and a mobile app. There are some inconsistencies which most likely are just down to me not figuring out something. But ton's of googling and AI ain't helping. I've done the setup (several times) as per the tutorial and using postman and I'm able to call /auth/login successfully for a user that had been created using createsuperuser My confusion/uncertainty starts when I try signup a new user via /auth/signup. It is "sort off" successful. I say sort of because the user does get created in the DB but I do not receive the email asking the user to Confirm Their Email. When I however try register the same email/user again, I now get an email saying [example.com] Account Already Exists. So I do know email delivery (using mailhog) is working. Here are my allaluth settings: HEADLESS_ONLY = False ACCOUNT_USER_MODEL_USERNAME_FIELD = None ACCOUNT_LOGIN_METHODS = { "email", } ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*",] ACCOUNT_SIGNUP_FORM_CLASS = "authy.forms.CustomSignupForm" ACCOUNT_EMAIL_VERIFICATION = "mandatory" # Ensures users must verify their email ACCOUNT_EMAIL_VERIFICATION_BY_CODE_ENABLED = True ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL = None # or a url ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL = None # or a url ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3 … -
Signals with Channels updating one value at the time
I'm using a m2m signal that triggers django channels, to create a realtime update on a value. It works fine but if I go to the admin and update more than one at the same time (having multiple tabs opened) it only updates 1 tab in real time and the others I need to refresh that. Does anyone know why it behaves like this? -
Deployed Django Rest Framework API gives "Server got itself in trouble" on any call with payload
I am deploying my Django Rest API to a web server running on Ubuntu 24.04 LTS Linux and using the Apache web server. This web server is external; I have not set it up, and so some of the details on how it works is a blackbox to me. I have run into a very annoying error in which I will get a 500 error saying "Server got itself in trouble" whenever I add payload to any sort of request. It doesn't matter the method: it can be a GET, POST, PUT, PATCH or DELETE and it will still run into the error... However, when I run a request without a payload, I don't run into this error (I run into expected errors for not including expected request data instead)... Here are some details on the server, that could give insight: The app runs within a Gunicorn container Client requests go to a reverse proxy and they are redirected to the app The app handles incoming requests and is listening out for them Here is also the settings.py I am using. I have DEBUG=True for now to try to get to the root of the issue... """ Django settings for … -
Error making django-oauth-toolkit migrations with add_token_checksum
I have a Django application that has been running for quite some time and I want to update the django-oauth-toolkit library. In this case the upgrade would be from version 2.4.0 to 3.0.1. The problem is that when I run the command python manage.py migrate the field of oauth2_provider.00XX_add_token_checksum is never set to OK, it stays processing and never stops. What the console shows me is the following: Operations to perform: Apply all migrations: admin, auth, contenttypes, oauth2_provider, sessions, users Running migrations: Applying oauth2_provider.0011_refreshtoken_token_family... OK Applying oauth2_provider.0012_add_token_checksum... What could it be? -
Cannot connect to websocket
I have app on Django Channels that use Daphne as a termination server and hosted on AWS EC2. So problem is, when i run app locally(or via ngrok) and try to connect everything is working, i have connection with websocket. But if i try to connect not locally, i get this: 17-03-2025 18:57:13 | django.request | WARNING | Not Found: /ws/chat/ 17-03-2025 18:57:13 | gunicorn.access | INFO | "GET /ws/chat/?first_user=19628&second_user=19629 HTTP/1.1" 404 179 routing.py from django.urls import path from apps.chat.consumers.consumers import ChatConsumer websocket_urlpatterns = [ path('ws/chat/', ChatConsumer.as_asgi()), ] asgi.py import os import django os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.main') django.setup() from channels.auth import AuthMiddlewareStack # noqa: E402 from channels.routing import ProtocolTypeRouter # noqa: E402 from channels.routing import URLRouter # noqa: E402 from django.core.asgi import get_asgi_application # noqa: E402 from apps.chat.middlwares.queryparams import QueryParamsMiddleware # noqa: E402 from apps.chat.routing import websocket_urlpatterns # noqa: E402 application = ProtocolTypeRouter( { 'http': get_asgi_application(), 'websocket': AuthMiddlewareStack(QueryParamsMiddleware(URLRouter(websocket_urlpatterns))), } ) settings.py ASGI_APPLICATION = 'apps.asgi.application' INSTALLED_APPS += [ # Third-party apps 'daphne' 'django.contrib.admin', 'django.contrib.auth', ... 'channels', # Local apps ... 'apps.chat.apps.ChatConfig', ] CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': { 'hosts': [os.environ.get('REDIS_URL', ('127.0.0.1', 6379))], }, }, } docker-compose.yml volumes: pg_data: driver: local x-base: &base-backend build: . volumes: - .:/code depends_on: - db … -
Template does not exists error in python anywhere
I have deployed my django app in python anywhere and getting below error : TemplateDoesNotExist at /topic/ cms_app\content.html I have two apps in my project. One is cms_app and other is users. My templates location is Content_Mgmnt/cms_app/templates /cms_app/content.html For users and other cms_app templates are working fine however for /topic/ url this is not working and showing templates does not exists. The same code is working fine in development environment however giving issues in production. How to solve this error? -
Twilio TTS Mispronounces "Aradhya" – How to Fix It?
I’m using Twilio's text-to-speech (TTS) in a Django view to read out a message before connecting a call. However, Twilio mispronounces the name "Aradhya", and I’m looking for a way to fix it. Problem: Twilio reads "Aradhya" incorrectly, and I want it to sound like "Uh-raa-dhyaa" (अाराध्य in Hindi). Code (Simplified Version): from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from twilio.twiml.voice_response import VoiceResponse @csrf_exempt def connect_call(request): response = VoiceResponse() customer_name = "John Doe" # Example; this is fetched dynamically in actual code response.say(f"Hello {customer_name}, I am Aradhya. Please hold while we connect you.") response.dial("+919836731154") # Connect call return HttpResponse(str(response), content_type="application/xml") What I Tried: Changing the spelling (e.g., "Aaraadhyaa", "Aradyaa") → No improvement. Using SSML <phoneme> tag: <Response> <Say> I am <phoneme alphabet="ipa" ph="əˈrɑːðjə">Aradhya</phoneme>. </Say> </Response> Issue: Twilio still mispronounces it. Adding pauses with <break>: <Say>Hello, I am <break time="200ms"/> Aaraadhyaa.</Say> Issue: Slight improvement, but not perfect. Using Twilio Neural Voices (Amazon Polly): <Response> <Say voice="Polly.Aditi">Hello, I am Aradhya.</Say> </Response> Issue: Not all Twilio accounts support Polly voices. Question: How can I get Twilio TTS to pronounce "Aradhya" correctly without using pre-recorded audio? Any help would be appreciated! -
Invalid Argument: X-Amz-Security-Token when my django-based website hosted by vercel tries to get static files from cloudflare r2
First of all: I have a R2 bucket on cloudflare that is public, allows any origins and any headers, and works completely fine. I'm using django-storages to storage and retrieve static files from that bucket, it works completely fine with the collectstatic command and is configured like so: CLOUDFLARE_R2_CONFIG_OPTIONS = { "bucket_name": os.getenv('AWS_STORAGE_BUCKET_NAME'), "default_acl": "public-read", "signature_version": "s3v4", "endpoint_url": os.getenv('AWS_S3_ENDPOINT_URL'), "access_key": os.getenv('AWS_S3_ACCESS_KEY_ID'), "secret_key": os.getenv('AWS_S3_SECRET_ACCESS_KEY'), } STORAGES = { "default": { "BACKEND": "storages.backends.s3.S3Storage", "OPTIONS": CLOUDFLARE_R2_CONFIG_OPTIONS, }, "staticfiles": { "BACKEND": "storages.backends.s3.S3Storage", "OPTIONS": CLOUDFLARE_R2_CONFIG_OPTIONS, }, } All the env variables are correct both in my local file and in my Vercel project settings. The problem is: When I try to get my static files running the server locally, I can get it without any issue. But when my hosted website tries to get it, it returns Invalid Argument: X-Amz-Security-Token . My console presents the following logs: A resource is blocked by OpaqueResponseBlocking, please check browser console for details. Loading failed for the <script> with source “https://0f69b46e85805ed2f43733e43b3c9d42.r2.cloudflarestorage.com/red-lily-art/static/teste.js?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fc2577758bc2bd91c1e1022852b8e3cb%2F20250317%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250317T130205Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEO3%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJGMEQCIFvc%2F5JClCQ8o%2FGX8RNXEpe0LMctOAwwo0qN6YdtYmwAAiAdQ1vNe2ZdGRCy4bwIfvTe8CFy%2ByM7ZFu1O%2BeXdmJd3CrVAwhGEAMaDDY5MzU2ODkzNTA0MSIMzXoCS2fBSfvwBKTXKrIDl2MbDq6bezh5eKOXhGJuszK20Yqy3PgXmFdu945fK2RY8qPAvmxgHGPIhr2gi4wz0e4lOYiWHDzptMCBM%2FdISRQW2Yl6J7UIpQ0m1tE9%2FKLrC30JOVj1uPOtDyNrxF5TMGAuzX6%2FPaj6rezUdIa2AzT7cf3v1w%2BrQg781axTRL07H02ZHcJteVyFWclCth%2FrLvWPgHLxU3jgOTTxkpVycib%2F%2BcA0QTrU58x2pedmC5JfMI10fekZS1ZjBWprA9bDN3csTw6cyo6TICcbTMqH9i5xu2xRDIt6yDr6GS0876VDITy57qC5AdXX71Cgd7YdmgEYSmWFTSEYklJfsnjzHMqX7KtahskM%2BjTyrfHhtJ85NEWXfuxfUdR0d5jaN72K%2B6qbsYbopUjty7CJyo%2FwgjS7BF4P66gQNFBALc9d1R%2F92B%2BPvvpyXiD5j58ZJ5oC65W%2BlOGW96QPTCwO9b5M0ppmmO7K887wq5uVmGqZPoy7dymflBOsiAiDYYNYdyTfskRus7utsEYr0UMldBqKkheBRthKTr%2FIMtgdDGFS7YPPcE99Gu%2B%2FvO1diPH3pHlw3iEwyrrgvgY6nwHHzJTW6CRoh3VBIOe6GsNTop8DsRliEZK4jyOvn%2Btzk%2BEAvSQyfnVI7TSJIDyw%2FcV1S5OZq%2Fw%2Fd6U%2Fnuvjiyxto%2FvYXVhKxJumc4TpEQ3XqlX11hckBvSngjB6EUGL%2FjVI%2BxpgWnNx7HmU4xSct2pnfoOa3fYj8HvhZ58hH2K8T3vdm1gQ%2FIesyfMgy8TIrwMiXlgf29RIQ2MsTE8f16U%3D&X-Amz-Signature=a33b4d6841de2678820682bd4337a2c04ddc65fcb09646cafe8804530df4d31d”. -
la commande makemigrations pools
I got stuck at the second step of the tutorial at docs.djangoproject.com/fr/5.1/intro/tutorial02/. When I run the makemigrations polls command, the result is: PS C:\Users\user\desktop\djangotutorial> python manage.py makemigrations polls Traceback (most recent call last): File "C:\Users\user\desktop\djangotutorial\manage.py", line 22, in <module> main() ~~~~^^ File "C:\Users\user\desktop\djangotutorial\manage.py", line 18, in main execute_from_command_line(sys.argv) ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line utility.execute() ~~~~~~~~~~~~~~~^^ File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\core\management\__init__.py", line 416, in execute django.setup() ~~~~~~~~~~~~^^ File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\apps\config.py", line 190, in create raise ImportError(msg) ImportError: I don't understand where the problem is coming from. I tried to go through the settings.INSTALLED_APPS settings under the microscope without success. I need your help. -
I don't really know how to phrase this but I'm currently using Django, that is being picked up through my vs code but its not registering my apps
INSTALLED_APPS = [ # MY APPS: "learning_logs", # DEFAULT APPS: 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] My teacher has helped me, we even turned to AI, but nothing is working. For example, my teachers code runs perfectly on his side, and he even gave me his code however mine is still not working. So, we think 'MY APPS' is not being picked up on. Btw this is from my settings.py So, after changing code and even using his it's not working. Every time I run my server and follow the link it takes me to the default Django home page when it's supposed to give me my web page. I hope this makes sense, I've been struggling with this problem for 3 days.