Resolving DJANGO Error: “ValueError: invalid literal for int() with base 10: ‘None'”

Sun, Oct 11, 2009

Tech Tips

If you receive this error via email while viewing one of your admin pages, here are some steps to help resolve it. First note the problem URL. It should be in the detailed error email. Try the url in your browser and verify you receive the same error. Now you have to find the page that is linking to this invalid URL.

In my case, it was an image tag that I included in the admin list display. In my custom field code, I did not handle the “None” case. So instead of displaying a broken link it was trying to load the None image in my admin directory. Generating the URL that was causing the issue:
/admin/myApp/myModel/None/

Bookmark and Share
,

Comments are closed.