title: Using telethon with a django application
body: <p>I want to watch updates on telegram messages in an django application and interact with django orm.</p>
  <p>I found <a href="https://github.com/LonamiWebs/Telethon" rel="nofollow noreferrer">telethon</a> library, it works with user api which is what I want.</p>
  <p>Below code simply works on its own.</p>
  <pre><code>from telethon import TelegramClient
  from telethon import events
  
  api_id = 231232131
  api_hash = '32131232312312312edwq'
  client = TelegramClient('anon', api_id, api_hash)
  
  
  @client.on(events.NewMessage)
  async def my_event_handler(event):
      if 'hello' in event.raw_text:
          await event.reply('hi!')
  
  
  client.start()
  </code></pre>
  <p>But telethon requires phone message verification and it needs to work in a seperate thread.</p>
  <p>I couldn't find a way to put this code in a django application. And when django starts, I dont know how to bypass phone verification.</p>
  <p>It should always work in an seperate loop and interact with django orm. Which is very confusing for me.</p>