Skip to content

How to run your bot locally

Nikita Shamaev edited this page Sep 15, 2022 · 1 revision

Quickstart: Polling & SQLite

The fastest way to run the bot is to run it in polling mode using SQLite database without all Celery workers for background jobs. This should be enough for quickstart:

git clone https://github.com/ohld/django-telegram-bot
cd django-telegram-bot

Create virtual environment (optional)

python3 -m venv venv
source venv/bin/activate

Install all requirements:

pip install -r requirements.txt

Create .env file in root directory:

cp .env_example .env

Run migrations to setup SQLite database:

python manage.py migrate

Create superuser to get access to admin panel:

python manage.py createsuperuser

Run bot in polling mode:

python run_polling.py 

Run your server and go to admin-panel. Use credentials from previous step.

python manage.py runserver
Clone this wiki locally