I'm very new to Python and Django so maybe someone can point me in the right direction.
I have the following url.py line
      url(r'^$', direct_to_template,
                  {'template':'index.html',
                  'extra_context':{'featured_actors': lambda: User.objects
                                    .annotate(avatars_nb=Count('avatar'))
                                    .filter(actor_profile__is_featured=True, avatars_nb__gt=0)
                                    .order_by('?')[:4]},
                 }, name='index'),
All this was working perfectly fine for a long time but for no reason that I can see all of a sudden I'm getting this template error.
 TemplateSyntaxError at /
 Caught an exception while rendering: (36, 'File name too long')
On line 70
 66   {% if featured_actors|length %}
 67       <div id="featured"> 
 68         <h2>Featured Actors: </h2>
 69         <ul>
 70             {% for actor in featured_actors %}
 71             <li> 
 72                 <a href="{% url public_profile actor.username %}">
 73                     <img src="{% avatar_itself_url actor.avatar_set.all.0 200 %}" alt="{{ actor.profile.firstname }} {{ actor.profile.lastname }}" style="max-width:140px" height="200"/> 
 74                 </a>
 75             </li>
 76             {% endfor %}
What is the best way to debug this?
UPDATE
 126     def avatar_url(self, size):
 127         return self.avatar.storage.url(self.avatar_name(size))
I think I found a bit of the problem, one of the user profiles is also giving the same error. So I think it must be a avatar/image path for him that is too long. I'm trying to narrow it down...