Could not parse the remainder: '(Avatar.objects.filter(user =[0].imagen.url)

Template error:

        <!-- Page content wrapper-->
        <div id="page-content-wrapper">
            <!-- Top navigation-->
            <nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
                <div class="container-fluid">
                    {% if request.user.is_authenticated %}
                        <p> Hola! {{request.user.first_name}} </p>
                        <img height="50px" src={{avatar}}>
                        <img height="15px" src={{(Avatar.objects.filter(user =[0].imagen.url)}}>
                    {% else %}
                        <p> Hola Visitante! </p>
                    {% endif %}

You cannot put arbitrary python code in your templates.

You want your views to gather all the data needed by a template, then pass that data to the rendering engine in the context for the rendering engine to use with the template.