I want to display first character of user in django templates. I want to make a image of user first character like caption or avatar

like this https://meta.discourse.org/t/switch-from-gravatar-to-html-css-letters-for-no-avatar-users/15336


so i will get result like any name "Gaurav" or "Amit" but i just want first letter of them like "G" or "A" So i can display it like image of first letter.



First letter:

{{ postone.user|make_list|first }}

Word without first:

  • The problem is you can no longer use the filter "richtext" on the item after the join. How can i pick the first letter and still apply richtext.
    – sqwale
    May 17 '17 at 14:13

try <p>{{ postone.user.first_name.0 }}</p>


Your Answer

