Errors in models

Course : Django with Python Premium
Mentor : Jatin Katyal

Errors are :
img = models.ImageField(upload_to = ‘images/’)
It show error install pillow after installing pillow again it show error ‘you are trying
to add a non-nullable field ‘img’ to tablename wthout a default : after using default = True same error again’

last_modified = models.DateTimeField(auto_now_add = True)
it also show error " TypeError : expected string or bytes-like object "

Hello @vermas.123, as I said can you pls try if once by clearing your db.sqlite3 file and migrations files except __init___.py . It is coming maybe for last_modified field you have initialised or set some value that is not exactly in the date format.
Try this out, if it doesn’t work let me know.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like