Skip to content

sinarezaei/django_telethon_multisession

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

!alt text alt text

Django Telethon MultiSession

A Telethon session storage implementation backed for Django ORM to use telethon in django projects.

Tested with:

  • Python 3.7+
  • Django 2.2+

Use the following command to install using pip:

pip install django-telethon-multisession

Usage example

Usage is very simple, just follow three simple steps below

Add Django-Telethon-Session to your installed apps

First add django telethon session to your installed apps in your django project settings:

INSTALLED_APPS = [
    ...,
    'django_telethon_multisession',
    ...
]

Migrate the database

Then run migrate command to create migrations in database.

python manage.py migrate

Use custom session

Use the session in django_telethon_multisession.sessions to initialize telegram client:

from django_telethon_multisession.sessions import DjangoMultiSession
client = TelegramClient(DjangoMultiSession("session_name"))

Feel free to send pull requests or report issues!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages