[Answer]-Django automaticly save models with Author

1👍

Your issue is:

class PostAdmin(admin.ModelAdmin):
    ...

does not have author as a field, and it is a required field.

Now, when you are saving the model from the admin, author field is NULL and according to the database it is not nullable. Hence the error.

Now, to fix it, add author as a field in the Post admin

0👍

Amazing solve this problem – django-custom-user

Leave a comment