title: Django: in template take only first 2 letters of a variable taken by database
body: <p>I'm new to Django and I'm trying to get only the first 2 letters of a Variable Name passed on by the database.</p>
  <p>Here's my HTML code:</p>
  <pre><code>&lt;td class=&quot;process-title&quot;&gt;
  &lt;p data-letters=&quot;{{account.variable_name}}&quot; class=&quot;text-accounts&quot;&gt;
  {{account.variable_name }}&lt;/p&gt;
  &lt;/td&gt;
  </code></pre>
  <p>In the data-letters Tag I'd like to pass only 2 letters instead of the whole word.</p>
  <p>This is my view.py:</p>
  <pre><code>def accounts(request):
      if request.user.is_authenticated:
          all_accounts = Accounts.objects.all().order_by('variable_name')
          context = {
              &quot;accounts&quot;: all_accounts,
          }
          return render(request, 'engine/accounts.html', context)
  </code></pre>
  <p>I'm attaching a picture of the result I'm trying to achieve.
  How can I achieve this?</p>
  <p>Thank you all
  <a href="https://i.stack.imgur.com/owMPA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/owMPA.png" alt="enter image description here" /></a></p>