Category index for “api”

  • OAuth and django rest framework

    Star

    OAuth and django rest framework

    This is a well known topic, but i can’t find the existing solution that will fully satisfy me. So i write it by myself :).

    Assume we have a “single page” web site, that is talking with backend via REST API. Client side can be written with ember, angularjs or some like this. Backend - django rest framework (DRF). We’ve got a task - add social login (OAuth protocol).

    Comments Read More
  • OAuth step by step

    OAuth step by step

    OAuth protocol has two versions: 1.0 and 2.0.

    Most of services today use version 2.0, i suppose because it is easier to implement. Also, 2.0 can be realized in standalone applications (those, that don’t have a server).

    To understand the protocols very useful to have a look at their realisation. Here i’ll show several scripts that talk to OAuth providers of different versions. Scripts will implement client application functionality. Only standard python libraries are used. This help to overview the OAuth protocol - everything is on single screen and familiar. Of course, for production application we must use third party oauth libs, they handle many special cases and so on. Purpose of these scripts is just understanding of the protocol and nothing else. It is often hard to keep the protocol flow in production-ready library, because it is splitted in many modules, some other packages are used. And the full vision is slipping out of sight.

    Comments Read More
  • Send email in django project with mandrill service

    Send email in django project with mandrill service

    To send email messages from server we can just use SMTP protocol. But there is another way - special email services. I’ll describe one of them here, mandrill.com.

    Comments Read More
  • Async Bitcoin RPC client

    Star

    To work with Bitcoin RPC from python there is a library Python-BitcoinRPC.

    But recently i need to call API from tornado application. Mentioned lib works in synchronous, i.e. blocking mode. For tornado it will be much better to use asynchronous version. Tried to search for existing solution, but can’t find it. So i create my async fork, that use tornado’s AsyncHTTPClient: https://github.com/st4lk/python-bitcoinrpc-tornado.

    Comments Read More
  • Script for downloading music from vkontakte

    Script for downloading music from vkontakte

    A quick search of corresponding python script doesn’t give results. In post on habra link is broken. So i decided to write my own bicycle, it is avaliable here.

    Launch (needs installed python interpreter):

    python vkcom_audio_download.py
    

    Tested on python 2.6 and 2.7. No external libraries required.

    Comments Read More
  • Aphorism messenger

    Aphorism messenger

    I have an interesting project I want to tell you about. The idea to create it was born when I was learning Java. I have read couple of books, made some small task programs but I would like to create something bigger.

    Comments Read More