[Django]-ValueError at / Invalid format string

4👍

The problem is this call:

self.pub_date.strftime('%b %e %Y')

%e is not a valid directive for strftime. If you just want to display the date, use something like this:

self.pub_date.strftime('%b %d %Y')

You can see a full list of the directives you can use here

Leave a comment