I'm trying to get Django automatically add a field to an object where the date and time is saved in the field as a timestamp.
When I create the object in my view and I go check in admin page, every other field is created but not this one.
views.py :
newconf = ConfigUser.objects.create(
        ref=''.join(random.SystemRandom().choice(
            string.ascii_lowercase + string.ascii_uppercase + string.digits
        ) for _ in range(20)),
        name='',
        user=request.user,
        # Here I don't add created_at because I want it to be automatic (see models.py)
        cpu=cpu[0],
        gpu=gpu[0],
        ram=ram[0],
        ssd_m2=ssd_m2[0],
    )
models.py :
class ConfigUser(models.Model):
    ref = models.CharField(max_length=20, unique=True, default='')
    name = models.CharField(max_length=128, default='')
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    created_at = models.DateTimeField(auto_now_add=True)
    cpu = models.ForeignKey(CPU, on_delete=models.CASCADE)
    gpu = models.ForeignKey(GPU, on_delete=models.CASCADE)
    ram = models.ForeignKey(RAM, on_delete=models.CASCADE)
    ssd_m2 = models.ForeignKey(SSD_M2, on_delete=models.CASCADE)
    def __str__(self):
        return self.name
 
     
    