Posts RSS Comments RSSTwitter 18 Posts and 32 Comments till now
This wordpress theme is downloaded from wordpress themes website.

Django-Hessian

About
The django-hessian library serves objects via Django using the Hessian RPC protocol.

Requirements
The django-hessian library requires a version of the mustaine Python Hessian library >=0.1.3 which includes a Hessian WSGI server implementation.

See http://github.com/safehammad/mustaine.

Usage
Objects can be served using a djangohessian.Dispatcher at a given URL with an entry urls.py.  The following example serves an object of type server.Calculator at the URL http://localhost:8000/rpc/calculator/ in the Django development server, use the following:

mysite/myapp/server.py:

from djangohessian import exposed
class Calculator(object):
    @exposed
    def add(self, a, b):
        return a + b

    @exposed
    def subtract(self, a, b):
        return a - b

mysite/urls.py:

from django.conf.urls.defaults import *
urlpatterns = patterns('',
    url(r'^rpc/', include('mysite.myapp.urls')),
)

mysite/myapp/urls.py:

from django.conf.urls.defaults import *
from djangohessian import Dispatcher
from server import Calculator
urlpatterns = patterns('',
   url(r'^calculator/', Dispatcher(Calculator())),
)

Note that any methods you wish to expose on the served object must be decorated with @exposed

The following is a sample client interactive session written using the mustaine Hessian library:

>>> from mustaine.client import HessianProxy
>>> h = HessianProxy('http://localhost:8000/rpc/calculator/')
>>> h.add(2, 3)
5
>>> h.subtract(7, 3)
4

Sources
Up-to-date sources can be found at http://bitbucket.org/safehammad/django-hessian.

7 Responses to “Django-Hessian”

  1. [...] byproduct of this is a django-hessian, a library which enables the serving of Hessian objects in Django. Objects can be served using a [...]

  2. on 08 Feb 2013 at 21:03Carson

    Fantastic beat ! I would like to apprentice while you amend
    your site, how can i subscribe for a blog website?

    The account helped me a applicable deal. I were tiny bit acquainted of this your broadcast offered shiny transparent idea

  3. on 04 Nov 2014 at 07:29hongjiang

    i tried this example, but got a 403 Forbidden response. I am using django 1.7. Do you know why this happens?

  4. on 27 Jan 2015 at 21:47Arlene

    Your page’s template looks ugly. You schould change it. Better
    graphics means a lot more conversions, faster load and greater
    confidence of visitors. This is something that can be
    useful for you, search in google:
    Juicklor’s templates source

  5. on 31 Oct 2016 at 22:439apps android

    Hi there I am so delighted I found your web site, I really found you by error,
    while I was researching on Yahoo for something else, Anyhow I
    am here now and would just like to say kudos
    for a tremendous post and a all round entertaining
    blog (I also love the theme/design), I don’t have time to browse it all at
    the minute but I have book-marked it and also added in your RSS feeds,
    so when I have time I will be back to read much more, Please do
    keep up the fantastic job.

  6. on 28 Nov 2016 at 10:59https://goo.gl

    Hi to all, it’s in fact a pleasant for me to pay a quick visit this
    website, it consists of useful Information.

  7. on 29 Nov 2016 at 03:30https://goo.gl/uAoEAJ

    It is in reality a great and helpful piece of
    information. I’m glad that you shared this useful info with us.

    Please keep us informed like this. Thanks for sharing.

Trackback this post | Feed on Comments to this post

Leave a Reply