Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmytrostriletskyi/55e7f3ce8ffad6ba4d44bb8e2a0bb45a to your computer and use it in GitHub Desktop.
Save dmytrostriletskyi/55e7f3ce8ffad6ba4d44bb8e2a0bb45a to your computer and use it in GitHub Desktop.
The widget generation using django-telegram-login
from django.conf import settings
from django_telegram_login.widgets.constants import (
SMALL,
MEDIUM,
LARGE,
DISABLE_USER_PHOTO,
)
from django_telegram_login.widgets.generator import (
create_callback_login_widget,
create_redirect_login_widget,
)
bot_name = settings.TELEGRAM_BOT_NAME
bot_token = settings.TELEGRAM_BOT_TOKEN
redirect_url = settings.TELEGRAM_LOGIN_REDIRECT_URL
telegram_login_widget = create_callback_login_widget(
bot_name, corner_radius=10, size=MEDIUM
)
telegram_login_widget = create_redirect_login_widget(
redirect_url, bot_name, size=LARGE, user_photo=DISABLE_USER_PHOTO
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment