Category "django"

Django Migration from Github actions

Hello I have a database in Google Cloud Platform and I am trying to figure out how to run a django migration from github actions once I have deployed my app to

Django converting isoformat string datetime to tuple and rising error

I'm trying to update two datetimefields for the Skill entity in my db. I'm sure I'm passing an isoformat datetime string. When creating instead of updating ever

Trying to Upload database file using python requests and sending to django API

Hi I have a database file. I want to send this database file via python requests post method to my django server and store this database file somewhere in my se

Django Github CI cannot connect to mysql 'db'

Issue When trying to setup a Github action to test a Django project automatically, we ran into an issue with the django.yml setup. Whenever we ran the .yml, we

Django Github CI cannot connect to mysql 'db'

Issue When trying to setup a Github action to test a Django project automatically, we ran into an issue with the django.yml setup. Whenever we ran the .yml, we

In Python how can I overwrite the class attribute of an inherited class, where that attribute is itself an instance of a model?

As in the title, I have a base class ListView, with a Serializer attribute that needs overwriting. For each of my django models I create a child ListView class

Intercept specific function invocations using parent/child classes?

I am writing a framework that allows us to intercept certain function invocations so that we can manage them(enforce timeouts and retries, persist return

Django multiple distinct values queryset for SQLDB

I'm trying to get a list of results that have distinct x and y values, but I also want to return color along with them. Since I'm using an SQLDB I'm not allowed

API view returning { "detail": "Not found." },

class User(models.Model): user_id = models.CharField(max_length=255, unique=True) mobile = models.CharField(max_length=12) first_name = models.CharF

Custom field with special constrains in DRF serializer

I'm trying to add a custom field with some special constrains in DRF serializer. Following are 2 sample models: class ModelA(models.Model): field1 = models.

How to remove extra puncuation marks during saving forms data in django?

when ever i add data to the form i got extra puncuation marks in the value as shown in the image. for example - name = xyz while saving i get name = ('xyz',) Th

How to use a CNN code in python inside a website?

I have website with backend in Python (Django) and JavaScript hosted on heroku. Also, I have code in python that does image classification with EfficientNet, so

How to get rid of TypeError at /task_create/, quote_from_bytes() expected bytes

I am on django 4.0.4 and have a benign but annoying problem with the above error code. Previous responses to similar questions don't help me. When I backspace,

how to change form field from dropdown list to radio button in django if the options in dropdown are being inherited from another model?

i am working on an application where i can select item from drop-down list and buy them. i have a form field which is a drop-down list(items are connected to ot

Django many-to-many relations

I'm trying to create a web app in which users can participate in some groups (every user can be part of multiple groups), and I want to be able to make both que

When I gave command on CMD manage.py runserver it instead took me into VS Code and when i ran it in VS code error was on (from django.core.management)

When I ran the command on CMD manage.py runserver it intern redirected to VS Code. When I tried to run on VS Code it showed the system cannot find the specified

Django: The QuerySet value for an exact lookup must be limited to one result using slicing

i am tring to access a page using a slug url, but i keep getting this error The QuerySet value for an exact lookup must be limited to one result using slicing.

Celery task is pending in the browser but succeeded in the python shell of Django

I'm using Django, Celery, and RabbitMQ for simple tasks on Ubuntu but celery gives no response. I can't figure out why the task is pending in the browser, while

When i create Django Project with environment i have had a mistake line but when i deleted the environment file the line had disappeared !! Any Idea?

import os from django.core.wsgi import get_wsgi_application // Mistake in any import commands line but it is working os.environ.setdefault('DJANGO_SETTINGS_MODU

How can I get .vscode folder and settings.py file on my django project

I was following a tutorial on django . The tutor was using Mac OS he got the .vscode folder and settings.py in json But I can’t access that on my windows