Is it possible to draw a line in the viewport ?

I am wondering if it’s possible to draw a colored relationship lines between several objects in the viewport?

For example, there is a Sphere and a Cube in the scene (names of the objects). Cube has a custom property “target” with value “Sphere”. I need to have a cyan colored line connecting centers of these two objects (if I move objects around, the line between them should adjust accordingly).

Is it achievable through Python ?

Yes, you can using OpenGL.

Oh, hmm… Could you please provide an example how to set it up in script (for 2.74+) ?

See Operator Modal Draw example in Text Editor > Templates > Python.