I have a model Item class Item(models.Model): id = models.IntegerField(primary_key=True) title = models.CharField(max_length=140, blank=True) descr
In my admin.py of my admin dashboard app I added this following code: class MyAdminSite(admin.AdminSite): def index(self, request, extra_context=None):
I was making a web app using Django. I was using Django 3.0.7 for the sake. Then I upgraded to Django 3.1.1. When I reinstalled Django 3.0.7 I am unable to open
Django has superuser, staff, admin… superuser and staff are in django.contib.auth.models.UserManager. Then there is the createsuperuser command of djan
In a Django project, I have a custom user model that adds one extra field: class User(AbstractUser): company = models.ForeignKey(Company, null=True, blank
I have a pre_save signal handler on a bunch of models, which write to a different database. If something goes wrong, I'd like to abort the whole save, or faili
I have a model with a field channel (JSONField). I'm strong an array of string in db with channel. By default, a JSONField is shown as a textarea in django-admi
Well, I want to save any instance of a model without taking care about DDBB structure. So I decide to override def save in every model´s class. Kind of: