Django的Chatwork集成

django-chatwork的Python项目详细描述


Travis CICOVERALLSCode ClimateIssue CountLICENSE MIT

django chatwork是django的chatwork集成。

要求

  • python>;=3.5
  • django>;=1.11

快速启动

  1. 通过pip安装

    # instal from PyPI
    pip install django-chatwork
    
    # install from github master branch
    pip install -U https://github.com/kacchan822/django-chatwork/archive/master.tar.gz
    
  2. 将“聊天室”添加到已安装的应用程序中

    INSTALLED_APPS = [
        ...
        'chatwork',
        ...
    ]
    
  3. 在“设置”中设置值

    # You have to set this
    CHATWORK_API_TOKEN = 'youre api token'
    
    # You don't have to usually set this
    CHATWORK_API_ENDPOINT_BASE =  'https://api.chatwork.com/v2' # default
    CHATWORK_API_BACKEND = 'chatwork.backends.http.UrllibBackend' # default if DEBUG = False
                                                                  # if DEBUG = True, the value set 'chatwork.backends.dummy.DummyBackend' as default
    CHATWORK_API_FAIL_SILENTLY = None   # default
    
  4. 用法

    from chatwork import send_message
    
    ...
    
    # send message to room_id = 123456
    send_chatwork('message text hear', 123456)
    
    # send message to room_id = 123456 with [To:] for all members
    send_chatwork('message text hear', 123456, to_all=True)
    
    # send message to room_id = 123456 with INFO format
    # INFO format contains [To:] for all users
    send_chatwork('message text hear', 123456, title='info title')
    
    ...
    

致谢

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java操作String类型的arraylist   数组问题导致java无限循环   Java服务包装器环境变量引用问题   MongoDB聚合减去Java驱动程序3.3   如何使用java配置配置spring security 3.2以使用dao身份验证和自定义身份验证过滤器   java从url下载文件   java试图使用这个系统。作为RDD中的一项任务   java是否可以使用ajax request to controller方法而不使用ResponseBy注释来返回重新编译的jsp?   使用Netty在Java中实现twitter欺骗节俭客户端服务器   java我想读取一个文件并检查一个单词是否存在于文件中。如果单词存在,我的一个方法将返回+1   java JPA Hibernate N+1问题,即使使用Join Fetch   java组织。阿帕奇。平民vfs2。FileSystemException:无法设置的上次修改的时间戳   java protoc没有干净地退出,缺少:1)com。谷歌。protobuf:protoc:exe:${os.detected.classifier}:3.6.1   java如何使用ApacheDs将POJO映射到目录?   java当Spring security基本身份验证中的身份验证失败时,如何返回ResponseEntity<>(HttpStatus.UNAUTHORIZED)?   java空指针异常spring 3   java如何在安卓中创建具有附加功能和转换功能的捆绑包   java大字符串资源减慢了我的应用程序