Archive

Posts Tagged ‘Django’

Zato 1.0. The next generation ESB and application server. Open-source. In Python.

May 18th, 2013 No comments

 

(This is a re-post of what I sent to python-announce@ but with several screenshots attached)

I’m very happy to announce the first release of Zato, the next generation ESB and application server, available under a commercial-friendly open-source LGPL license.

https://zato.io

What can you expect out of the box?

  • HTTP, JSON, SOAP, Redis, AMQP, JMS WebSphere MQ, ZeroMQ, FTP, SQL, hot-deployment, job scheduling, statistics, high-availability load balancing and more
  • Incredible productivity with Python
  • Painless rollouts with less downtime
  • Slick web admin GUI, CLI and API
  • Awesome documentation (several hundred A4 pages)
  • 24×7 commercial support and training

Project’s site: https://zato.io
Download: https://zato.io/download/zato-1.0.tar.bz2
Support: https://zato.io/support
Docs: https://zato.io/docs
Architecture: https://zato.io/docs/architecture/overview.html
Tutorial: https://zato.io/docs/tutorial/01.html
GitHub: https://github.com/zatosource
Mailing list: https://mailman-mail5.webfaction.com/listinfo/zato-discuss
IRC: irc://irc.freenode.net/zato
Twitter: https://twitter.com/zatosource
LinkedIn: https://www.linkedin.com/groups?gid=5015554
Diversity statement: https://zato.io/docs/project/diversity.html

Spread the news and enjoy :-)

Cheers!

 

 

 

 

 

 

 

Share

“CSRF verification failed. Request aborted. CSRF token missing or incorrect.” with Django and YUI

September 30th, 2011 Comments off

So if you have a piece of YUI Javascript code similar to the one shown below

function foo() {
 
    var on_success = function(o) {
        alert('Yay!');
    };
 
    var on_failure = function(o) {
        alert('Oh ones!')
    }
 
    var callback = {
        success: on_success,
        failure: on_failure,
    };
 
    var url = '/url/to/invoke';
    var transaction = YAHOO.util.Connect.asyncRequest('POST', url, callback);
}

and the URL the AJAX call invokes returns the “CSRF verification failed. Request aborted. CSRF token missing or incorrect.” error, the easiest way to properly handle is to set the custom X-CSRFToken HTTP header to the same value the csrftoken cookie has been set by Django to, just like the Django documentation says it can be done.

In code terms, that will do the trick

function foo() {
 
    var on_success = function(o) {
        alert('Yay!');
    };
 
    var on_failure = function(o) {
        alert('Oh ones!')
    }
 
    var callback = {
        success: on_success,
        failure: on_failure,
    };
 
    var url = '/url/to/invoke';
 
    YAHOO.util.Connect.initHeader('X-CSRFToken', YAHOO.util.Cookie.get('csrftoken'));
    var transaction = YAHOO.util.Connect.asyncRequest('POST', url, callback);
}

Hoping this helps someone some day! :-)

@fourthrealm

Share
Categories: Software Tags: , , ,