79
votes
5answers
74k views

Capturing url parameters in request.GET

I am currently defining regular expressions in order to capture parameters in a url, as described in the tutorial. How do I access parameters from the url as part the HttpRequest object? My ...
54
votes
4answers
10k views

What's an appropriate HTTP status code to return by a REST API service for a validation failure?

I'm currently returning 401 Unauthorized whenever I encounter a validation failure in my Django/Piston based REST API application. Having had a look at the HTTP Status Code Registry I'm not convinced ...
40
votes
11answers
19k views

Adding REST to Django [closed]

I've got a Django application that works nicely. I'm adding REST services. I'm looking for some additional input on my REST strategy. Here are some examples of things I'm wringing my hands over. ...
42
votes
8answers
30k views

Django and Restful APIs

I have been struggling with choosing a methodology for creating a RESTful API with Django. None of the approaches I've tried seem to be the "silver" bullet. WAPI from http://fi.am is probably the ...
11
votes
1answer
3k views

How do I handle file upload via PUT request in Django?

I'm implementing a REST-style interface and would like to be able to create (via upload) files via a HTTP PUT request. I would like to create either a TemporaryUploadedFile or a InMemoryUploadedFile ...
6
votes
2answers
2k views

Does Django have a way to open a HTTP long poll connection?

Leave the connection open, until an event occurs.
37
votes
3answers
6k views

What are the differences between django-tastypie and djangorestframework?

Why would you use one over the other, for exposing an API for your Django app? http://pypi.python.org/pypi/djangorestframework/ http://pypi.python.org/pypi/django-tastypie
18
votes
4answers
13k views

Using django-rest-interface

I have a django application that I'd like to add some rest interfaces to. I've seen http://code.google.com/p/django-rest-interface/ but it seems to be pretty simplistic. For instance it doesn't seem ...
5
votes
4answers
3k views

How to secure a REST API for mobile applications?

I am trying to add a REST interface to Django for a mobile client. The mobile client will use JSON over HTTPS. I have not been able to find the "best" way to accomplish this for mobile devices. ...
4
votes
2answers
2k views

Tastypie filtering with multiple values

I had a simple question on filtering in tastypie. I want to filter with multiple values. For example: /api/v1/message/?accountId=1,5,12 This doesnt work. Any idea how i can do this? Do i need to ...
1
vote
3answers
1k views

Django's Querydict bizarre behavior: bunches POST dictionary into a single key

I'm experiencing a really bizarre behavior when using the test client in django. I'm using a POST to send data to my django app. I usually do this from an iPhone app and/or a test html form. On the ...
7
votes
2answers
630 views

ModSecurity: Output filter: Failed to read bucket (rc 104): Connection reset by peer

I'm doing a POST request to a rest service made with django and piston uploading a file, but when I do the request i get this (strange?) error: [Sun Jul 04 16:12:38 2010] [error] [client ...
5
votes
2answers
2k views

How do you get Django to make a RESTful call?

Note: I'm not trying to provide a RESTful api, I'm trying to call one. def index( request, *args, **kwargs ): context = {} context['some_json'] = make_remote_api_call( ...
4
votes
2answers
2k views

django-tastypie and many to many “through” relationships

In Django and Tastypie I'm attempting to figure out how to properly deal with Many to Many "through" relationships, like those found here: ...
1
vote
1answer
2k views

A socket operation was attempted to an unreachable network in python httplib

I am trying to make a REST client from django using httplib . But it is refusing the connection I tried the following import hashlib import hmac from django.shortcuts import render_to_response from ...

1 2 3
15 30 50 per page