Skip to content

turleo/shortshort

Repository files navigation

ShortShort

This is a simple link shortener, which I wrote to practice in Django and webhooks.

Web version

Telegram bot

VK (🤮) bot

How to run

  1. Clone
  2. Install packages
pip install -r requirements.txt
  1. Write configuration to .env file
SECRET_KEY="Secret key for django"
ALLOWED_HOST="Domain name/IP address of your ShortShort instance"
  1. Create database
python manage.py makemigrations
python manage.py migrate
  1. Run it
python manage.py runserver

Telegram bot

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.

VK (🤮) bot

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"

Screenshots

Web Telegram