Demokritos Moving to Django
I've previously written about the fact I'm porting Quisition to Django (a port which is going well, by the way).
I've decided that it would be useful for me to port my Atom Store, Demokritos, to Django as well. Much of what's left to do in Demokritos is provided by Django so I think it's a good move.
I'm not aware of any APP implementations for Django, so that will be a useful contribution I can make.
One of the nice things about doing my own implementation from scratch was I could build in a REST philosophy from the foundation up. Hopefully Django won't get in the way in this regard.
Comments (6)
doug Napoleone on Jan. 5, 2007:
Just wanted to point out that Django already comes with an ATOM Feed.
http://www.djangoproject.com/documentation/syndication/#specifying-the-type-of-feed
Currently available feed types are:
* django.utils.feedgenerator.Rss201rev2Feed (RSS 2.01. Default.)
* django.utils.feedgenerator.RssUserland091Feed (RSS 0.91.)
* django.utils.feedgenerator.Atom1Feed (Atom 1.0.)
The Atom1Feed implementation is a good place to start for how to integrate Demokritos with Django.
Chimezie on Jan. 6, 2007:
Have you considered porting to http://code.google.com/p/brightcontent/ ?
RESTful, WSGI-based, accessible content (GRDDLable-RDFa).
irc:///freenode.net/brightcontent
James Tauber on Jan. 7, 2007:
Thanks for the pointer to Bright Content, Chimezie. I wasn't aware of it. Sounds a lot like Leonardo.
Ivan Sagalaev on Feb. 25, 2007:
I'd like to note that URL schemes that Django encourages are not purely RESTful. While getting and changing entries usually look fine:
GET /collection/
GET /collection/{id}/
POST /collection/{id}/
Adding and deleting don't:
POST /collection/add/
POST /collection/delete/
This is encouraged partly by docs ad partly because urlconfs dispatch only by URIs and not by HTTP methods. So to implement GET and PUT on a collection or POST and DELETE on an item one should write if-else forks manually. Or create a custom url dispatcher that works after urlconf.
Ivan Sagalaev on Feb. 25, 2007:
Oops... 'POST /collection/delete/' should be 'POST /collection/{id}/delete/'.
Add a Comment
Last Modified: Jan. 5, 2007
Author: James Tauber
Doug Napoleone on Jan. 5, 2007:
Django lends its self very well towards RESTfull sites. The admin which is just a seperate app which comes with django, is 99% REST (there are a few corners like user password creation).
Read up on the 'get_absolute_url' and the 'ABSOLUTE_URL_OVERRIDES' setting. That is all you need to have a full REST site. At that point syndication and site index are just app plug-ins that just work.
All the default views use REST as well.
Django wants to be RESTfull, it just gives you the power to do alot more and doesn't restrict you to REST (which is not the end all, be all for all problems).