Without seeing what ``Authentication`` class you're using & what
you're trying to send, it's hard to know what's going wrong. Seeing a
pastebin of the code would help greatly.
As far as sending data, Tastypie accepts any supported content-type
is can deserialize. At current, that's JSON/XML/YAML. To POST data,
you create a serialized version of what you want to send (say as
JSON), then post that JSON as the body of a request to the API. You
can find examples of this in the test suite (for example -
https://github.com/toastdriven/django-tastypie/blob/master/tests/basic/tests/views.py#L43).
If you need to post-process that data once it's been deserialized,
you'll need to hook into the ``hydrate`` portions of the ``Resource``
(you can think of this as being similar to ``Form.clean_FOO`` &
``Form.clean`` in Django). Again, there are examples in the test
suite.
The goal is to get these things documented, but my time has been
short lately.
Daniel
The code looks fine (though you're lacking
``authentication/authorization`` on ``UserResource``, dunno if that's
important or not). The next question is which resource are you trying
to access, what HTTP method are you using and have you provided your
HTTP Basic auth credentials for an authorized user when performing the
request?
Daniel
It's possible to do that and I don't think it's a silly use of an
API. You're storing user data from a not-necessarily-web-based program
& allowing fetching that same data elsewhere (if I understand
correctly), which seems perfectly reasonable.
Where this breaks down a bit is the "login" screen. What comes with
Tastypie is written largely for machine access & sending the
credentials upon each request. REST-style APIs ideally should be
state-less, which establishing a session via a login-form isn't. That
said, with a custom view to get them to do the usual Django login
dance (think django-registration) & a custom ``Authentication`` class
in Tastypie that checks ``request.user.is_authenticated``, you
shouldn't need much code to get there & make it work.
Daniel