I'm currently working on a Python project where I'm trying to get category from its own related subcategories. However, I'm encountering an issue where the subcategory field, it doesn't show anything. There are 4 files that i'm uploading: This …
Here is the error message: Got an error checking a consistent migration history performed for database connection 'default': connection failed: could not receive data from server: No route to host Here is my .env POSTGRES_DB=ibm_skiller POSTGRES_PASSWORD=mYP@sSw0rd POSTGRES_USER=ibm_skiller POSTGRES_HOST=172.19.0.2 POSTGRES_PORT=5432 …
I'm currently trying to serialize the following object into the models listed below, the current relationship is A Category has many quizzes, a quiz belongs to one category, while containing many questions, a question belongs to a quiz, while containing …
I'm having trouble with my Django URL patterns. The URL exercise4/1/ is not matching any of my defined patterns, even though I have a pattern defined for exercise4/int:month/. Can you help me figure out why it's not matching?" <pre class="lang-py …
Enter image description here enter image description here its little different since i had to start another one but i encounter '[Errno 2] No such file or directory' and it has become quite the …
Given the following model (using django-simple-history): class MyModel (models.Model): status = models.IntegerField() history = HistoricalRecords() I would like to get all instances that didn't have a certain status on a given date (i.e. all instances that …
I've a django app running with gunicorn and nginx. While making request from [ALL https] project.vercel.app to backend.domain.com works correctly. But when i make request from domain.com (Devtools>RequestHeader>Origin : www.domain.com) to backend.domain.com, it gives CORS error "has been blocked by …
Serializers.py from django.core.exceptions import ObjectDoesNotExist from rest_framework import serializers from .models import FieldUser, BaseApplicant, Applicant, CoApplicant, Guarantor class VerificationMobileSerializer(serializers.Serializer): mobile_number = serializers.CharField(max_length=15) class FieldUserSerializer(serializers.ModelSerializer): class Meta: model = FieldUser fields = ['id', 'username', 'first_name', 'last_name', 'email', 'mobile_number', 'profile_photo', 'address', 'pin_code', …
Im using Django-rest-framework where the authorization is being done using bearer access token. The thing is, I want to do auth using the access token stored in cookie storage with HTTP-only. I'm using JWT, How can I handle the auth …
Am working on my django project , after uploading my file,picture or documents , when i try to download or view a file , I get error django.views.static.serve . my project is django project is connected to postgresql .i expect …
I am writing a website with Vue as a frontend framework and django as a backend framework. I have included the csrf token in every single request from my frontend to my backend to ensure that I dont get a …
I learned python and I'm good on python but is python good choice to use it with JavaScript(React + Next.js) And I use Python(Django + FastApi) as a backend lib Is JavaScript(React+Next.js) good with Python(Django + FastApi) as freelancer I …
So i am trying to accept multiple base64 images through an endpoint to create a post and this is the object dummie data i want to send. { "user": "username of the user", "caption": "Reasons why my Husky got mad …
I have a Django view that originally displays a list of applicants, and using the filter by session, it is expected to display list of applicants by the selected academic session. And using pagination, user is expected to scroll through …
I have a chatting application. I downloaded its template online (HTML, CSS, JS) and It uses Dropzone for file uploads, but I’m having a problem retrieving the file. When I upload the file, it creates a hidden input and previews …
I have been working on my first django, which is a portfolio website. The site was working as intended when running on the django server, however when configuring it with apache on the linux server I few things have stopped …
This makes a Django test using the test client run very much faster, where login security is not an important part of the test from django.test import TestCase, Client, override_settings @override_settings( PASSWORD_HASHERS = [ "django.contrib.auth.hashers.MD5PasswordHasher" ]) class Test2(TestCase): ... …
I have an SQL Server database that has mainly 3 tables and I want to create a crud web interface to manage it and I started with creating a Django API for the backend I followed some online guides to …
Im newbie in django.. i dont know why it's raise an error its models.py codes class PublishManager(models.Manager): def get_queryset(self): return super().get_queryset().filter(status=Post.Status.Draft) # Create your models here. # First Model class Post(models.Model): class Status(models.TextChoices): Draft = 'Dr', "Draft" Released = 'RL', …
I'm creating a odd one out game. Basically user are presented with four pics , one being the odd one when user selects the odd picture score gets increased by 1. The problem I'm having is I'm sending 4 pics …
I'm new to Django and trying to set up a DB Connection with SQL Server db. Earlier we had MySQL which was working fine, I'm having trouble connecting to SQL Server DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'AAAAA', …
I am new to vue.js and I try to update data. I write this code for pencil icon <i class="mdi mdi-pencil" v-b-modal.updateHolidayType ></i> I write this for modal <b-modal id="updateHolidayType" title="Update holiday" centered hide-footer> <ModalForm cardTitle="Update holiday" description="Update holiday" …
I am working on a django project, and taking over the project from other developers as they have left the project. I came across a query which I am not able to understand how it works, This is the query …
I'm having trouble with my app that generates 5-8sec videos. The entire request takes about 15 seconds, the app does all the steps required, but when it's time to download the video file it fails. I'm deploying the same python …
Trying to make an edit page where you can upload a profile picture and add various things to your profile, but when i click on edit profile i get "ValueError at /profile/ The 'profile_image' attribute has no file associated with …
Я попытался создать файл 'load_data.py', но ошибка сбила меня с толку. Traceback (most recent call last): File "/Users/name/Downloads/Dev/culture/culture/api/load_data.py", line 4, in <module> from models import Theatre File "/Users/name/Downloads/Dev/culture/culture/api/models.py", line 4, in <module> class Theatre(models.Model): ... ModuleNotFoundError: No module named …
Возможно, я делаю это совершенно неправильно. Я новичок в Django, поэтому иногда то, что я думаю о вещах, не похоже на то, что можно сделать с помощью Django. У меня есть две таблицы: class LocationGroup(models.Model): #Fields ##Location Group …
Какой стандартный или безопасный способ хранения учетных данных электронной почты Google Workspace в моем первом Django-проекте? Я пробовал хранить пароль в файле .env, но получаю всевозможные сообщения об ошибках (например, "модуль decouple не распознан" - несмотря на …
Я сталкиваюсь с проблемой отображения статуса в сканировании это в основном сканирует QR купона и говорит, что купон действителен или нет Я сохранил статус каждого купона в базе данных вместе с идентификатором купона Я разобрался с частью сравнения и …
Я создал программу AI Python и сделал экран программы видимым через плагин. Я пытаюсь запустить программу, написанную на Python, на этом экране, но она не работает. Как заставить ее работать? Чтобы запустить программу искусственного интеллекта, необходимо запустить Anaconda 3, …
Контекст: Я работаю над проектом, используя Django с фреймворком Django REST для создания API. Моя база данных - MySQL, а в качестве локальной среды разработки я использую XAMPP. Проблема: Мне нужно использовать хранимые процедуры в моем Django-приложении для …
Я новичок в Django, и я вижу желтые линии под всем, что я включаю из Django, например django.db import models Вижу желтые линии на Django.db и модели также в app.djando Во всех импортированных Django вещах Еда работает полностью нормально, …
У меня есть приложение, которое я недавно развернул на Heroku. Я написал приложение на Python с использованием фреймворка Django. Когда я создаю учетные записи пользователей через панель администратора в приложении, я вижу их после создания. По прошествии некоторого времени …
Я перевожу старую кодовую базу с Django ~2 на Django 4.2.1. Вместе с этим переходом я обновил psycopg2 до psycopg (также известного как psycopg3), но этот переход привел к тому, что мой курсор стал некорректно получать строки из базы …
Я использую xthml2pdf для создания счета-фактуры на арабском языке. Я много искал, чтобы решить эту проблему и следовал всем шагам, но я не знаю, почему это не работает. Код утилиты: def render_to_pdf(template_src, context_dict={}): template = get_template(template_src) html = template.render(context_dict) …
У меня проблема с кодом, написанным на Python и фреймворке Django Я написал пользовательскую модель и использовал в ней Abstrcatuser, а вместо поля имени пользователя использовал поле номера телефона. Теперь, когда я ввожу адрес логина в написанном мной api …
Я хочу иметь кликабельные метки для моих радиокнопок в django но я не могу нажать и значения не регистрируются в базе данных, это как просто текст <div class="probprior"> <div class="radio-container"> <label for="id_is_observer"> {{register_user_form.is_observer}} Observer </label> <label for="id_is_technician"> {{register_user_form.is_technician}} Technician …
У меня возникают проблемы с аннотацией в Django. У меня есть две модели в проектах. (только структура) model A (field:name(char)) model B (field:A(A; related_name="b"), user(user), content(char; null=True)) Данные model B такие же, как... row1 -> A:1, …
У меня есть следующее поле модели: category = models.ForeignKey("QuestionCategory", on_delete=models.CASCADE, null=False, blank=False ) Правильно ли поведение Django, что при выводе в HTML-форму, в списке выбора присутствуют все варианты (все категории), а также "пустой вариант", представленный ----------- (как …
Я создаю свое первое приложение на Django и у меня возникли проблемы с экспортом некоторых значений. У меня есть модель, назовем ее Машины, с некоторыми атрибутами (покупатель, имя, модель, серийный номер и т.д.). Другая моя модель - …