Skip to content

Repository files navigation

DJANGO BITRIX

Python lib for BITRIX API

INSTALLING

$ pip instlal bitrix

CONFIGURE YOUR APP AND BITRIX

  1. Create webhook in your Bitrix
    alt_tag
  2. Copy your webhook url (exclude profile/)
    alt_tag
  3. Create BITRIX_WEBHOOK_URL parameter in your settings.py and set equal to your webhook url
  4. Thats's it!

USAGE

You can use Bitrix24 class everywhere

  1. As mixin
from django.views.generic import View
from bitrix.main import Bitrix24

class ClassBasedView(Bitrix24,View):
    def do_someting(self):
        """
            do something
        """
        params = {
            'key1':'value1',
            'key2':'value2'
        }
        self.call_method("your method",params)
        
  1. With django.signals
from django.db.models.signals import post_save
from django.dispatch import receiver
from bitrix.main import Bitrix24

@receiver(post_save, sender=YourModel, dispatch_uid="sell_levels")
def set_level(sender, instance, created, **kwargs):
    """
        do something
    """
    bx24 = Bitrix24()
    params = {
        'key1':'value1',
        'key2':'value2'
    }
    bx24.call_method("method",params)    

About

Python library for Bitrix

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages