I had accidentally misplaced the tab indentation of two def __unicode__(self):
methods in my models.py. I.e. for two models, I had done the following:
class Notification(models.model):
recipient = models.OneToOneField(User)
timestamp = models.DateTimeField()
def __unicode__(self):
return "%s recieved a notification" % self.recipient
The def
statement was at the same level as the class, the return
statement was indented as if the method header was properly indented.
I corrected it and pushed to production (a Postgres setup w/ Heroku). If I access the admin panel locally (on SQLite), these data models populate correctly now. But if I try to access the admin panel of my live app, I get a 500 response and through NewRelic, I find that:
exceptions:UnicodeDecodeError /django.contrib.admin.options:changelist_view exceptions:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 68: ordinal not in range(128)
I looked at similar questions such as these, but they don't seem to apply to my case. What is django.contrib.admin.options:changelist_view
, and what exactly is that error trying to tell me. I need help in resolving this guys.
p.s. this pertains to a legacy project using Django 1.5 and Python 2.7