title: Run telegram bot with uWSGI
body: <p>I have a Django app running on nginx+uWSGI.</p>
  <p>Inside my Django app there is a Telegram bot (python-telegram-bot).
  It is a Long Polling bot, not a Webhook one.</p>
  <p>Django part is completely ok, I managed to configure uWSGI and nginx.</p>
  <p>Bot is ok as well, while I run it with:</p>
  <pre><code>python bot.py
  </code></pre>
  <p>But I want to run it with uWSGI (emperor mode) and I can't find any tutorials on how to make it work.</p>
  <p>Here is my bot code (a small part. It actually has a dozen of commands and uses Django models):</p>
  <pre><code>import os
  os.environ.setdefault(&quot;DJANGO_SETTINGS_MODULE&quot;, &quot;app.settings&quot;)
  import django
  django.setup()
  
  from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
  from telegram.ext import (
      Updater,
      CommandHandler,
      CallbackContext,
      PicklePersistence,
  )
  from app.secrets import tg_token
  
  
  def start(update: Update, context: CallbackContext) -&gt; None:
      update.message.reply_text('hi')
  
  
  def main() -&gt; None:
      persistence = PicklePersistence(
      filename='arbitrarycallbackdatabot.pickle', store_callback_data=True)
      # Create the Updater and pass it your bot's token.
  
      updater = Updater(tg_token, persistence=persistence, arbitrary_callback_data=True)
  
      updater.dispatcher.add_handler(CommandHandler('start', start))
  
      # Start the Bot
      updater.start_polling()
  
      # Run
      updater.idle()
  
  
  if __name__ == '__main__':
      main()
  </code></pre>
  <p>Any ideas on how to configure uWSGI to run my Django app and bot.py at the same time?</p>