NoReverseMatch problems

The identifier category does not exist at that line. I’m going to guess that you probably want i.id based upon the identifier you’re using in your loop.