Questions tagged [django-piston]

A mini-framework for Django for creating RESTful APIs.

Piston is a relatively small Django application that lets you create application programming interfaces (API) for your sites.

It has several unique features:

  • Ties into Django's internal mechanisms.
  • Supports OAuth out of the box (as well as Basic/Digest or custom auth.)
  • Doesn't require tying to models, allowing arbitrary resources.
  • Speaks JSON, YAML, Python Pickle & XML (and HATEOAS.)
  • Ships with a convenient reusable library in Python
  • Respects and encourages proper use of HTTP (status codes, ...)
  • Has built in (optional) form validation (via Django), throttling, etc.
  • Supports streaming, with a small memory footprint.
  • Stays out of your way.

NB: OAuth ships with piston for now, but you are not required to use it. It simply provides some boilerplate in case you want to use it later (consumer/token models, urls, etc.)

Learn More:

Piston Bitbucket Wiki

Piston Documentation

159 questions
32
votes
4 answers

Django RESTful API - django-piston vs. django-tastypie

We're looking for a general RESTful API solution for our Django project. We would use the API at first for Ajax calls on the web site and later for mobile apps, external apps and things like that. I found two modules which seem to be widely used.…
j7nn7k
  • 17,995
  • 19
  • 78
  • 88
24
votes
2 answers

Any good tutorials on using OAuth with Piston?

I've looked at the relevant section of the Piston documentation, but it only seems to focus on how to turn it on, not what it would look like for clients or how to test it to verify it's working. The example only seems to use HTTP Basic and curl.…
Hank Gay
  • 70,339
  • 36
  • 160
  • 222
16
votes
4 answers

How do I update an already existing row when using ModelForms?

I have a question on how to update an existing row in my database when one of the fields is my primary key. I am using ModelForm and Django-Piston - my main goal here is to have RESTful Post send to my webservice. I am able to have initial Posts be…
letsgofast
  • 257
  • 1
  • 3
  • 7
12
votes
8 answers

How to ensure that a python dict keys are lowercase?

I have a dict that I want to convert in JSON using simplejson. How can I ensure that all the keys of my dict are lowercase ? { "DISTANCE": 17.059918745802999, "name": "Foo Bar", "Restaurant": { "name": "Foo…
Natim
  • 17,274
  • 23
  • 92
  • 150
12
votes
1 answer

Running Django-Celery in Production

I've built a Django web application and some Django-Piston services. Using a web interface a user submits some data which is POSTed to a web service and that web service in turn uses Django-celery to start a background task. Everything works fine in…
Przemek
  • 459
  • 7
  • 16
12
votes
2 answers

How do I make Django-Piston to include related child objects in the serialized output?

I am pulling my hair out here because this isn't working for me and seems like it should be. I am using Django-Piston to develop an API and have 2 models, Building and Building Area. BuildingArea has a ForeignKey to Building as there are multiple…
Ashemah
  • 410
  • 4
  • 11
11
votes
7 answers

I get a 400 Bad Request error while using django-piston

I am trying to use Piston to provide REST support to Django. I have implemented my handlers as per the documentation provided . The problem is that i can "read" and "delete" my resource but i cannot "create" or "update". Each time i hit the relevant…
Cheezo
  • 761
  • 9
  • 24
9
votes
1 answer

Recommended configuration for both web client and mobile REST api security

I realize there are a ton of questions on this subject, and I have been researching this for a couple days now. I want to make sure my question is as specific as possible since I have yet to gain a full understanding of the best approach. Currently…
jdi
  • 90,542
  • 19
  • 167
  • 203
9
votes
4 answers

RESTful APIs for Django projects/apps

What do you prefer when you want to "RESTify" your Django project in Django? I came to the conclusion that there are really three options to do that: django-piston http://bitbucket.org/jespern/django-piston/wiki/Home django-rest-interface…
Ali
  • 1,396
  • 14
  • 37
9
votes
1 answer

Complete 'django piston with oauth support' example

I have followed a number of tutorials and examples on the web to setup and use django piston. They all work flawlessly, until i try to integrate oauth authentication. I have been working against the following…
Benjamin Dell
  • 2,841
  • 3
  • 18
  • 12
8
votes
4 answers

Django-piston: How can I get app_label + model_name?

Before I was just using the build-in django serializers and it added a model field. { pk: 1 model: "zoo.cat" } How can I get the same model field using django-piston? I tried fields = ('id', 'model') but that didn't work.
Pickels
  • 33,902
  • 26
  • 118
  • 178
8
votes
1 answer

What is the right way to write a django-piston client?

I've been reading a lot on django-piston and using to to make an API for an app I'm development, but I'm getting hung up on the client side of the world. I've written the handlers and uri mappings, and I can return JSON or XML to my heart's content.…
eddieroger
  • 523
  • 2
  • 8
7
votes
3 answers

Reverse URL problem with Django and Tastypie

We're porting our API from Django - Piston to Django-TastyPie. Everything went smoothly, 'till we got to this: urls.py of the app url(r'^upload/', Resource(UploadHandler, authentication=KeyAuthentication()), name="api-upload"), …
Lennart-
  • 519
  • 1
  • 6
  • 19
7
votes
4 answers

Is django-piston mature enough?

I'm developing an advertising site and want to use web services for the requests. I mean, a publisher site will put a JavaScript snippet and it will pull a banner through a REST GET. Is the django-piston framework mature enough to implement this…
santiagobasulto
  • 11,320
  • 11
  • 64
  • 88
7
votes
3 answers

RESTFUL web services consumed by web and native mobile apps with authentication in python using django framework

I have to write RESTFUL web-services with authentication in python using django framework which will be consumed by web based clients and mobile native apps (Android and IOS). the simple example would be that user will log in using email and…
Muneeb Ahmad
  • 180
  • 1
  • 1
  • 14
1
2 3
10 11