This is a simple link shortener, which I wrote to practice in Django and webhooks.
- Clone
- Install packages
pip install -r requirements.txt
- Write configuration to
.env
file
SECRET_KEY="Secret key for django"
ALLOWED_HOST="Domain name/IP address of your ShortShort instance"
- Create database
python manage.py makemigrations
python manage.py migrate
- Run it
python manage.py runserver
To run telegram bot you need to add token form BotFather to .env
file
TOKEN_TG="Telegram bot token from BotFather"
Also, you have to set up webhook manually. To do it follow this link:
https://api.telegram.org/bot{Your bot token}/setWebhook?url=https://{Your bot domain}/bots/tg/
You will receive JSON file.
You have to add this values into your .env
file. You can find instruction for first two values here and for third value here
SECRET_VK="Secret key for VK"
CONFORMATION_VK="Conformation for vk, to approve your webhook"
TOKEN_VK="Access token for your VK bot"