This is the base.html the block content is between the header and the footer <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <h1>header</h1> {% block content %} {% endblock content %} <h1>footer</h1> </body> </html> …
I'm doing the update function but I get a message Page not found enter image description here views.py def detalle_tarea(request, tarea_id): if request.method == 'GET': tarea = get_object_or_404(Tarea, pk=tarea_id) form = TareaForm(instance=tarea) return render(request, 'tarea_detalles.html', {'tarea': tarea, …
Google currently does not show my website's favicon in its search results and I learned that it is becuase it should be located at example.com/favicon.ico. I'm looking for a simple way to do this, hopefully without relying on redirects. I've …
I'm writing django webapp, and part of it is to generate view and convert it to png image. (any ideas other then below are appreciated). I've looked at some tools to convert "html to png", but there is mainly problem …
I'm deploying a Django application using the Django Rest Framework (DRF) on a server behind Nginx. The application is accessible via https://my-site.com/api/ where /api is routed to the Django application. However, when I access the API's browsable …
I have a Django project, everything goes well, but when I tried to handle the expiration of the session I got confused In a test view print(request.session.get_session_cookie_age()) give me this error SessionStore' object has no attribute get_session_cookie_age According to the …
Знает ли кто нибудь как полностью бесплатно опубликовать сайт на django через какой нибудь хостинг? Если да, то дайте ссылку на этот хостинг, и по возможности видео о нём, если таковое есть.
Struggling with this issue for a few days now so any help is greatly appreciated. I managed to deploy my django project on a Linux server and it works fine apart from the model form submit. On the local development …
I could not find better solution. I have IDs and ranks in my Redis. Is it possible for me to save the changed ranks to the database before the Redis key expires?. can I trigger some function before it expires …
I am trying to set up CVAT to support login using a custom IdP with OpenID Connect. I tried to make changes to base.py and docker-compose.override.yml to configure the server, but once I build and launch CVAT, nothing happens. I …
Генерирую токены, получаю refresh и access токены. Когда я по /logout передаю refresh токен, то он больше не действует, но access токены, полученные, с помощью этого рефреш токена, продолжает работать, до его срока истечения. Как избавиться от такого поведения, и …
I'm trying to make DRF work without custom serializers, views and urls, just using the default ones, but there is an issue with my login. Whenever i create a user on /api/v1/auth/register (this happens successfully) and then try to log …
I am developing a Django application using a Docker environment in PyCharm. Until now, I have been using pip for package management, but I am considering using uv to potentially reduce container build times. I managed to install uv in …
Всем привет,кто-нибудь работает с Джанго? Что нужно знать о базе данных,Чтобы работать с этим фреймворком? Моя база данных- PostgreSQL
Простейший web-терминал, сам по себе он работает, но любая команда(например ping), вывод которой подразумевает кирилицу, првращается в кашу из символов, в чём может быть проблемма и как это можно пофиксить? …
I am developing a POS system using Django. I have a Stripe account, and through the system I am developing, I can process payments using credit or debit cards, with the money being deposited into my Stripe account. This is …
I'm using these configuration: MEDIA_ROOT = os.path.join(BASE_DIR, 'media') DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' AWS_ACCESS_KEY_ID = '*****' AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY") AWS_STORAGE_BUCKET_NAME = '****' AWS_DEFAULT_ACL = 'public-read' AWS_S3_FILE_OVERWRITE = False AWS_S3_ENDPOINT_URL = 'https://****' AWS_S3_OBJECT_PARAMETERS = { 'CacheControl': 'max-age=86400', } AWS_MEDIA_LOCATION = 'media' PUBLIC_MEDIA_LOCATION = …
I'm trying to setup a project to send email from my local machine(MacOS) using django. But I see this error File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer This is code snippet that …
I have an app that I've built using Django and React + Vite. Everything runs fine with Debug set to True, but once I set it to false I get a Server Error with the console output of: ValueError: Missing …
I don't understand, what is the wrong. could you please let me know? which one do i need adjust? ValueError at /blog/15/ ModelForm has no model class specified. error messege picture which one do i need …
I'm new to Django and I'm attempting to build a website where a user can view a DB of books and related authors and add any book to their 'favourites'. I've been searching lots and I can't find a satisfactory …
I’m running a Django service that exposes endpoints via Django REST Framework. I want to secure these endpoints using Django OAuth Toolkit for authentication. When I create an application from the admin panel, I use the following settings: <a href="https://i.sstatic.net/Kh6elhGy.png" …
Hi i am new to django orm , can some body help me i have data models in django . class userprofile(models.model): foreignkey User related_name='fU' class A(models.model) foreignkey userprofile related_name='fa' Class B(models.model): forign key A related_name="fb" class C (models.model): foreignkey …
I have a Django 5.x app. I've been using psycopg2, and I'm now trying to update to psycopg 3. This is pretty simple: I uninstalled everything to do with psycopg2 and installed psycopg[binary]. However, when I run my test suite …
Error RuntimeError: Model class modules.firebase-push-notifications.models.Notification doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. for some reason i do not get this error when i try run manage.py runserver but if i use vscode debugger, this …
I have a recurring event in Google Calendar, and I need to fetch either the previous and next occurrence of this event, based on a given event ID. Specifically, I want to retrieve the event details for the exact occurrence …
Code I wrote a function that wraps Django's standard processing for raw SQL queries. def run_mssql_query(query, connection="prod", args=None): """Method will run query on MSSQL database Args: query (str): MSSQL Query connection (str): Which connection to use. Defaults to "prod". Returns: …
Im a bit new to Django REST and Django as a whole, how do you use a different table for auth since my api is looking for auth_user , it keeps saying "[42S02] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid …
So I'm using django.contrib.auth.urls and I would prefer to continue that. But I want the accounts/login url to be replaced with users/c-login or whatever. I would really like to understand why this is not working: my urls.py (project): from core …
I need to visualize data on Django-based webserver; which data is captured on serial port, like a stream. I use python **serial ** package to listen on the serial port, and I store these data in DB. I also have …
In my local development environment, I can easily run a PySpark application without configuring anything. However, on the server, we are using PyInstaller for EXE deployment. PyInstaller does not include the PySpark libraries' _internal folder in the executable, so I …
I wrote a function in Django which looks roughly like this: @login_required def make_appointment(request): existing_appointments = Appointment.objects.all() print('existing_appointments = ', len(existing_appointments)) new_appointment = Appointment() new_appointment.save() # ... And I call this from javascript using the following code: for(i=0; i<2; …
I'm using Django 5.1.3 for a project and the template references to the static files, despite being identical on three different servers, don't all point to the same relative location. The template tag {% static 'mystyle.css' %} is rendered in …
Import pandas as pd from PIL import Image from sqlalchemy import create_engine from sqlalchemy.pool import NullPool from dotenv import load_dotenv import socks import socket import os import io load_dotenv() CLIENT_ID = os.getenv("CLIENT_ID") TENANT_ID = os.getenv("TENANT_ID") CLIENT_SECRET = os.getenv("CLIENT_SECRET") DB_SERVER = …
While working with Django/Django Rest Framework, I noticed an inconsistency in how URL parameters are acccessed in class-based-views. Problem Description In Generic Class Based Views, I can access URL parameters in two different ways - depending on the …
I'm making an ecom site. When customer select Product size from dropdown boxes, it sends the correct selected size in backend but showing default value in frontend. My HTML code for this: <select class="form-select form-select-sm" id="size-cart{{ product.id }}"> {% for …
Enter image description here see using docker i take onlyoffice container then create api and integrate in react during run the code document not open in text editor help me to solve these issue if not then …
На главной странице отображается таблица со всеми протоколами, необходимо сделать поиск на сайте по Наименованию задачи (task_name) и должна выводится такая же таблица как и на главной, но с задачами, которые пытаются найти. Перепробовав разные способы, пересмотрев различные видео, у …
I am new to AWS. I had my Python Django project setup to host on AWS using EC2 INSTANCE WITH UBUNTU. It works when i run the project. After a while, may be 5 minutes later, when the site or …
I’m facing an issue with my Django application running in production on CPanel, and I'm using Passenger for WSGI. The application works fine on the local machine but on the live server it only works the root route (/), but …