title: Django email with smtp.gmail SMTPAuthenticationError 534 Application-specific password required
body: <p>I am trying to have django send emails but I am getting this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "/Library/Python/2.7/site-packages/django/core/mail/__init__.py", line 62, in send_mail
      return mail.send()
    File "/Library/Python/2.7/site-packages/django/core/mail/message.py", line 286, in send
      return self.get_connection(fail_silently).send_messages([self])
    File "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line 92, in send_messages
      new_conn_created = self.open()
    File "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line 59, in open
      self.connection.login(self.username, self.password)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 615, in login
      raise SMTPAuthenticationError(code, resp)
  SMTPAuthenticationError: (534, '5.7.9 Application-specific password required. Learn more at\n5.7.9 http://support.google.com/accounts/bin/answer.py?answer=185833 v14sm3323298pbs.11 - gsmtp')
  </code></pre>
  
  <p>The link suggested my to perform a 2-step verification which I did but still no results.</p>
  
  <p>In my settings.py</p>
  
  <pre><code>EMAIL_USE_TLS = True
  EMAIL_HOST = 'smtp.gmail.com'
  EMAIL_HOST_USER = 'email@gmail.com'
  EMAIL_HOST_PASSWORD = 'password'
  EMAIL_PORT = 587
  </code></pre>
  
  <p>I tried testing this in django shell but got the error shown above:</p>
  
  <pre><code>&gt;&gt;&gt; from django.core.mail import send_mail
  &gt;&gt;&gt; from django.conf import settings
  &gt;&gt;&gt; sub = "sup man"
  &gt;&gt;&gt; msg = "char lisss"
  &gt;&gt;&gt; from_user = settings.EMAIL_HOST_USER
  &gt;&gt;&gt; to = ["email@email.com"]
  &gt;&gt;&gt; send_mail(sub,msg,from_user,to, fail_silently=False)
  </code></pre>