Use string formatting instead of `str` for compatibility

Responding to comment: https://github.com/django/django/pull/576#discussion_r2521125

Signed-off-by: Rohan Jain <crodjer@gmail.com>