Category "django"

no such file libmariadb.3.dylib error when importing MySQLdb on mac M1

I migrated my data to M1 Monterey MacOS from intel macmini. I was happy to use django and mariadb until I installed a package using homebrew. I installed homebr

Pyscript in Django application

I am wondering if we could use pyscript on HTML pages inside a Django project. I'd tried to use it but unfortunately, it doesn't work. this is the code : <he

Trying to hide django secret key, but getting error when deploying in PythonAnywhere

I'm trying to deploy a django project. I hid the secret key putting it in a file called .env and added it to .gitignore, so I have django's secret key only loca

How do I preserve search result in Django pagination

I am new to Django and I have develop form with Country and State field from the Profile Model. If I search for country and a particular state, I want a list of

How to request to Gunicorn and respond with Daphne? Using Django channels, Nginx, Gunicorn, Daphne

I'm facing a strange issue in deploying Django app with Nginx, Daphne and Gunicorn. As of now, I have successfully deployed my Django app. My HTTP requests are

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