>From what I can see django would be a very convenient tool to build
webservices similar to the del.icio.us API (i.e. I'm not interested in
SOAP, XML-RPC, JSON, etc).
The only way I've found of extracting arguments is to use request.GET
like this
request.GET['arg1']
(Optional arguments (i.e. arguments with default values) could be done
using `request.GET.get('arg1', 'default value')`.)
This is a little cumbersome though since I need to enclose it in a
try-catch block to deal with missing arguments. Is there some
convenience function relating to this? Personally I was thinking of
writing a decorator that'd be used something like this:
@extract_arguments(['arg1', 'arg2'], ['arg3', 'arg4'])
def foo(request, arg1, arg2, arg3='default', arg4='default):
...
Another thing I'm wondering here is relating to authentication.
`django.contrib.auth` relies on sessions, which is good for sites but
is unnecessary for web services (again I'm looking at del.icio.us as a
good example). Is there a more light weight module available? Again
I've been thinking a little about it, what I think would be sufficient
is:
1. A minimal model for a user, just username and password.
2. A decorator that inspects the HTTP request for Basic-Auth headers,
does a lookup and calls the decoratee if the username/password matches.
Any thoughts on this?
Neither of these things would be amazingly difficult to write, I think.
I'm more than willing to do it myself, but if solutions are already out
there I'd rather use them (or at least take a look at them before
hacking my own :-).
/M
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---