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
0
votes
1 answer

Django-piston make piston return full traceback of exception

How to make piston return full traceback of exception. By default it returns me only last error text. Like id() takes exactly one argument (0 given) Need to know which file and which line...
Pol
  • 24,517
  • 28
  • 74
  • 95
0
votes
1 answer

AttributeError: 'TestHandler' object has no attribute 'model' in django piston

This is a test.py file that tries to send data to the api endpoint: import os import requests import uuid def get_uid(): return str(uuid.uuid4()) oauth_consumer_key = 'abcd' oauth_signature = 'efgh' oauth_signature_method =…
Hick
  • 35,524
  • 46
  • 151
  • 243
0
votes
0 answers

ImportError: No module named models django

When trying to create an API app using django-piston (v 0.2.3) and including the app namespace in the base url.py url(r'^news/', include('news.urls')), url(r'^api/', include('api.urls')), All my apps no longer import models and I get the following…
a11hard
  • 1,904
  • 4
  • 19
  • 41
0
votes
0 answers

HTTP Method "Patch" for Python's Piston Module

Through my extensive research I've discovered that there is an HTTP method becoming popular called "Patch" (it is being implemented in Rails 4.0). Its kind of like the PUT method, except it is used for attribute updating rather than replacing an…
Hoopdady
  • 2,296
  • 3
  • 25
  • 40
0
votes
1 answer

I use Django-piston, how i use handler.py to paging data from server?

My code class PointHandlerDynamic(BaseHandler): model = Points fields = ('Point_ID', 'X_Coor', 'Y_Coor', 'Seat_ID_ID') def Seat_ID_ID(self, instance): return instance.Sear_ID.ID def read(self, name=None): cursor =…
Hueston Rido
  • 809
  • 1
  • 11
  • 16
0
votes
1 answer

Change return-fields in read method django-piston

i'm using django-piston to create my api. I need to know if possible to change the return-fields according to a parameter. I'm trying to return a thumbnail field, but i need to have the option to pass the sizes of the thumbnail via URL. Thanks in…
eos87
  • 8,961
  • 12
  • 49
  • 77
0
votes
2 answers

“Invalid signature”: oAuth provider with Django-piston revisited using Scribe as a client

So while working through an implementation of OAuth using Django-Piston I encountered the error mentioned here: "Invalid signature": oAuth provider with Django-piston The solutions posted previously were not working for me so I began digging deeper…
Aron23
  • 23
  • 6
0
votes
1 answer

django-piston add value foreign key

I'm trying to insert from REST API Django-piston a new value on my database. I have the follow models class Mobile_User(models.Model): id = models.CharField(primary_key=True, max_length=255, unique=True) email = models.EmailField() name …
LaBE
  • 117
  • 1
  • 9
0
votes
2 answers

Heroku + Django + Piston

I'm using Heroku with Django and using Piston for API stuff. We migrated from plain Amazon EC2 to Heroku. Everything works (every aspect of the website) except for some of the API calls. When I run an API call to get a list of objects (trees) that…
Alexandre
  • 2,073
  • 4
  • 21
  • 24
1 2 3
10
11