Older blog entries for sness (starting at number 5091)

"R. Fielding
Request for Comments: 2616 UC Irvine"

'via Blog this'

Syndicated 2013-02-04 05:30:00 from sness

Python Diary | Good use for the Http-Accept header?

Python Diary | Good use for the Http-Accept header?: "While working on a project which needs to use JSON for AJAX functions, I thought about using the Http-Accept header to return content depending on what the client asks. Most web browsers send this header, and it is usually on the lines of, I accept anything in the XML mimetypes, including HTML. Since headers can be set from jQuery and various client software, I thought... Why not take advantage of this Http-Accept header and build a Django middleware to return the content which is accepted by the client. So far, it only detects and returns JSON, and there is no caching enabled. Keep in mind that this is my very first version of this middleware, which I did test and works as expected."

'via Blog this'

Syndicated 2013-02-04 05:25:00 from sness

View decorators | Django documentation | Django

View decorators | Django documentation | Django: "The decorators in django.views.decorators.http can be used to restrict access to views based on the request method. These decorators will return a django.http.HttpResponseNotAllowed if the conditions are not met.

"

'via Blog this'

Syndicated 2013-02-04 05:25:00 from sness

Django snippets: Accept Header Middleware

Django snippets: Accept Header Middleware: "Accept Header Middleware

import new

def accepts( self, mime ):
return mime in self.accepted_types

class AcceptMiddleware(object):
def process_request(self, request):
acc = [a.split(';')[0] for a in request.META['HTTP_ACCEPT'].split(',')]
setattr(request, 'accepted_types', acc )
request.accepts = new.instancemethod(accepts, request, request.__class__)
return None"

'via Blog this'

Syndicated 2013-02-04 05:24:00 from sness

REST APIs must be hypertext-driven » Untangled

REST APIs must be hypertext-driven » Untangled: "I am getting frustrated by the number of people calling any HTTP-based interface a REST API. Today’s example is the SocialSite REST API. That is RPC. It screams RPC. There is so much coupling on display that it should be given an X rating."

'via Blog this'

Syndicated 2013-02-04 05:12:00 from sness

HATEOAS - Wikipedia, the free encyclopedia

HATEOAS - Wikipedia, the free encyclopedia: "
HATEOAS, an abbreviation for Hypermedia as the Engine of Application State, is a constraint of the REST application architecture that distinguishes it from most other network application architectures."

'via Blog this'

Syndicated 2013-02-04 05:05:00 from sness

Welcome to Tastypie! — Tastypie 0.9.12-alpha documentation

Welcome to Tastypie! — Tastypie 0.9.12-alpha documentation: "Tastypie is an webservice API framework for Django. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces."

'via Blog this'

Syndicated 2013-02-04 04:58:00 from sness

django-backbone 0.2.3 : Python Package Index

django-backbone 0.2.3 : Python Package Index: "This app provides a Backbone.js compatible REST API for your models. It follows the Django admin pattern of extending, overriding and registering; and provides an extendable class based view for customization.

"

'via Blog this'

Syndicated 2013-02-04 04:57:00 from sness

Syncing Backbone Models in Real Time Over Socket.io | Flowdock

Syncing Backbone Models in Real Time Over Socket.io | Flowdock: "The New Flowdock was built from the ground up on top of Backbone.js. Since Flowdock is all about real-time messaging, our web app posts and receives messages via a Socket.io backend. To support saving messages through Socket.io instead of a REST API, we wrote a custom Backbone.sync method."

'via Blog this'

Syndicated 2013-02-04 04:46:00 from sness

javascript - Enable Django and Tastypie support for trailing slashes? - Stack Overflow

javascript - Enable Django and Tastypie support for trailing slashes? - Stack Overflow: "For a Backbone solution:

You can overwrite the default behavior of Model.url, even using the normal one and making a small modification like the one you are looking for:

// code simplified and not tested
var MyModel: Backbone.Model.extend({
url: function() {
var original_url = Backbone.Model.prototype.url.call( this );
var parsed_url = original_url + ( original_url.charAt( original_url.length - 1 ) == '/' ? '' : '/' );

return parsed_url;
}
});"

'via Blog this'

Syndicated 2013-02-04 04:45:00 from sness

5082 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!