I'm using the django-admin-async-upload library to handle asynchronous file uploads in my Django project. Everything works perfectly in my local development environment. However, when I deploy to the staging environment, attempting to upload a file results in a 302 redirect, …
For example, if I had these models, how can I make sure that only the name of the house is displayed in one view, and all of it's properties are displayed in an other. Also, how can I display the …
Current models: class Task(PolymorphicModel): pass class DownloadTask(Task): pass New models: And now i want to do add a new layer called VirtualTask: class Task(PolymorphicModel): pass class VirtualTask(Task): pass class DownloadTask(VirtualTask): pass Migration it looks like this: class Migration(migrations.Migration): …
I have a Django Model with one required field (shpid). I want to set this field to disabled when updating the form. Although the value of this field is shown and disabled when the template is first displayed I get …
Preview works fine locally but not on server.. I get the following error in browser console Error invoking action "load->w-preview#replaceIframe" SecurityError: Failed to read a named property 'scroll' from 'Window': Blocked a frame with origin "https://chandankhatwani.pythonanywhere.com" from accessing a …
I'm trying to build a Django project with Docker, but I always get this error and I don't know how to handle it: /usr/local/lib/python3.13/site-packages/django/coremanagement/commands makemigrations.py:160: RuntimeWarning: Got an error checking a consistent migration history performed for database connection …
I have developed an django based fully dynamic web application. Now I am deploying it & facing issue with the compatibility of the droplets. How much vCPUs required? How much RAM required? How much Storage required? I have …
"Whenever I host my website on GoDaddy.com and click on the homepage, it shows a message: 'Future home of something quite cool.'"
I am working on a headless website project, where I am implementing the backend through django using django-rest-frameworks, till now I was using this structure my_project/ ├── manage.py ├── my_project/ │ ├── __init__.py │ ├── asgi.py │ ├─ settings.py │ …
I am not able to post all the code however I will try my best to explain and hopefully someone will be able to assist! I am using Django's formtools. I have four sections of a form, they are each …
Django models now support default ordering, via Meta.ordering. What are the downsides to putting ordering = ["pk"] on my base model? In particular, I'm curious about the performance impact. The Django docs have a <a href="https://docs.djangoproject.com/en/5.2/topics/db/optimization/#don-t-order-results-if-you-don-t-care" rel="nofollow …
Im new in AWS and i tried migrating my files in EC2 and i see this error, is it a problem in my structure? I would really appreciate any help since im working in my portfolio and i cant seem …
I have the following setup in Django DRF: class TagSerializer(serializers.Serializer): id = serializers.UUIDField(read_only=True) name = serializers.CharField(required=True) style = serializers.JSONField(read_only=True) class TagCreationMixin: def create(self, validated_data): tags = validated_data.pop("tags", []) failure_mode = self.Meta.model.objects.create(**validated_data) for tag in tags: current_tag, _ = models.Tag.objects.get_or_create(**tag) failure_mode.tags.add(current_tag) …
Simple problem: the Python extension of VS Code is not seeing a Django class, while all other classes in same file are presented. Restarting, disabling/enabling, switch to pre-release for the extension doesn't change anything. Confirmed it was the extension as …
I have the following create function for ItemSerializer class. It aims to create new Item with tags, creating tags on the fly if they does not exist or getting them if they exist. class TagSerializer(serializers.ModelSerializer): class Meta: model = models.Tag …
Is there a way to set stdout and stderr from base_stealth_options in BaseCommand when running the django command? I can't find any documentation about how to use those options. For example, I would like to set stdout and stderr to …
I'm currently building a multi-tenant web application using Django and React. Right now, each user's page is available at a URL like https://mywebsite.com/. However, I want to change this so that each user has their own subdomain, …
I’m currently experiencing issues with my virtual machine named "monitoramentoati". When trying to access my application through the domain https://monitoramentoati.camf.org.br/admin/login/, I encounter the following error from Django: "OperationalError at /admin/login/ (2002, "Can't connect to local MySQL server …
I have a Tag Model and Mixin that is used for adding tags to entities whenever it is needed. class Tag(models.Model): name = models.CharField(max_length=64, unique=True) class TagMixin(models.Model): class Meta: abstract = True tags = models.ManyToManyField(Tag, blank=True) To create new …
I'm integrating Airwallex payment links into my web application. After a successful payment, instead of being redirected to my custom success URL (e.g., https://example.com/paymentsuccess), users are taken to the Airwallex default success page. Here's …
I'm working on a Django app where users upload large .txt files that need to be parsed and stored in a PostgreSQL database. The files can contain hundreds of thousands of lines, and processing them can take a long time. …
WARNINGS: ?: (staticfiles.W004) The directory 'C:\Ansh\ecom\django_project_boilerplate\static_files' in the STATICFILES_DIRS setting does not exist. System check identified 1 issue (0 silenced). You have 1 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): auth. Run …
Django 5.2, python 3.12.5 . I'm using in-built user model and no errors appear when I press the submit button. I created a view based on UpdateView and use the built-in UserChangeForm. The form actually returns 200 response code. I …
#I can not send data to my db, please help me to check.# Here is the model Model: class f_groupe_user(models.Model): IDF_GROUPE_USER=models.AutoField(primary_key=True) LibELE_GROUPE= models.CharField(max_length=120) Soc_sigle = models.CharField(max_length=120) created_at=models.DateTimeField(auto_now_add=True) updated_at= models.DateTimeField(auto_now=True) UTIL_CREATION= models.CharField(max_length=120) UTIL_MODIF= models.CharField(max_length=120) def __str__(self): return self.LibELE_GROUPE Here is …
Я работаю над своим основным проектом по разработке программного обеспечения в старшей школе, и при запуске моего проекта на Django я постоянно сталкиваюсь с этой ошибкой. Я следовал инструкциям, изложенным моим учителем, но я все еще не понимаю, что происходит. …
Я использую Amazon S3 в качестве хранилища файлов. Я попробовал использовать django image chopping 1.7 для обработки фотографий, это работает для отображения изображения без обрезки изображений django на веб-сайте, и я прочитал официальную документацию cover_photo = models.ImageField(upload_to='package_inner_photos', null=True, blank=True) cover_photo_cropping …
Я использую: Django 5.2.1 Попутный ветер CSS 4.0 хрустящий попутный ветер 1.0.3 джанго-хрустящие формы 2.4 Я использую пакет шаблонов Tailwind, который определен в моем settings.py. Когда я отрисовываю свою форму в моем шаблоне 'concert_form.html', используя crispy-forms, после одного …
Я пытаюсь настроить услугу подписки на своем веб-сайте с помощью Django. models.py from django.db import models from django.contrib.auth.models import User from django.utils.timezone import now class Subscription(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) customer_id= models.CharField(max_length=255) subscription_id = models.CharField(max_length=225, unique=True) product_name = models.CharField(max_length=255) …
Мне нужно знать, как я могу отправить видеофайл в качестве ответа в django. React+Django это мой код на django, который обрабатывает запрос. u/csrf_exempt def get_video(request): view_logger.info("Fetching video") try: if not LOGS_FOLDER_PATH: view_logger.warning("LOGS FOLDER PATH not present") return HttpResponseNotFound("Logs folder path …
Я создаю проект на Django-Unittest. Идея в том, чтобы позволить преподавателям нашего университета создавать и проводить онлайн-тесты на нем. Проблема, с которой я столкнулся, связана со страницей update_test.html, которая не выполняет предварительную обработку данных. Вот функция просмотра. @login_required …
Я пытаюсь использовать веб-интерфейс API для просмотра в Django Rest Framework. У меня есть объекты с данными временных меток в таком формате: "2025-05-08T22:02:58.869000-07:00". Но требуемый формат для datetimepicker в Django не поддерживает смещение UTC или последние три значащие цифры в …
У меня есть html-форма на сайте django, которая используется как для добавления, так и для обновления. Если форма предназначена для новой записи, я хочу, чтобы поле estimateType было переключателями с тремя вариантами выбора, одним из которых по умолчанию является checked. …
Я не уверен, что название этого поста помогло вам понять суть проблемы, но позвольте мне объяснить: У меня есть модели: class ItemCategory(models.Model): name = CharField() class Item(models.Model): brand = CharField() model = CharField() category = ForeignKey(ItemCategory) attributes = JSONField(default=dict) # …
Как я могу создать форму, даже если это не форма Django, а обычная форма с помощью ввода? Чтобы имена и элементы полей формы были взяты из столбца фрейма данных или столбца набора запросов. Я бы хотел, чтобы поля формы не …
В настоящее время я планирую создать Django-приложение, которое регулярно запускало бы задания в соответствии с условиями. Регулярно приложение должно проверять, выполняются ли условия в каком-либо из заданий, и запускать их с положительным результатом. Подумайте о условиях …
Я разработал простой проект django PWA (без опубликованного приложения django-pwa) для тестирования автономных функций. Я развернул свой проект на pythonanywhere: lecarrou.pythonanywhere.com. Когда я устанавливаю свое приложение на рабочий стол, оно становится доступным для установки (Chrome и Edge). Но у меня …
Я создал конечную точку в своем приложении Django, например: /accounts/api/login/. Она проверяет входные данные и возвращает JSON. Что касается кода Visual Studio, команда flutter run позволяет мне успешно войти в систему. Но если я попробую запустить приложение на эмуляторе Android …
Python manage.py runserver Но я получаю следующую обратную связь: Traceback (most recent call last): File "C:\Users\...\manage.py", line 22, in <module> main() ... File "...django\core\files\locks.py", line 32, in <module> from ctypes import ( File "...\Python313\Lib\ctypes\__init__.py", line 157, in <module> …
Я пытаюсь найти группы в чате по названию комнаты чата. Я использую Q-запрос Django... models.py class ChatGroup(models.Model): group_name = models.CharField(max_length=128, unique=True, default=shortuuid.uuid) groupchat_name = models.CharField(max_length=128, null=True, blank=True) picture = models.ImageField(upload_to='uploads/profile_pictures', default='uploads/profile_pictures/default.png', blank=True) about = models.TextField(max_length=500, blank=True, null=True) admin = …
Я использую платформу Okta и Django для разработки веб-приложения, и я столкнулся с ситуацией на моем локальном хостинге, которую, похоже, я не могу обойти. Я вхожу в виджет входа в Okta, он приводит меня к проверке Okta, а затем перенаправляет …