[Answered ]-Initialize field to constant value in django Form

1👍

You can set editable=False [Django-doc] to prevent the field to show up in ModelForms, ModelAdmin, etc.:

from datetime import datetime

class Source(Model):
    # …
    updated = models.DateTimeField(editable=False, default=datetime(2000, 1, 1), help_text="Most recent time this source has been updated")

Leave a comment