[Solved]-Django: 'created' cannot be specified for Order model form as it is a non-editable field

18👍

You need to add readonly_fields to your OrderAdmin, and add created to that list, such as:

@admin.register(Order)
class OrderAdmin(admin.ModelAdmin):
    ...
    readonly_fields = ['created']

The Django docs describe that when using fieldsets which contain read-only fields, those fields must be listed in readonly_fields for them to be displayed.

Leave a comment