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
2 answers

django feeds has wrong pub date

I have following problem. handlers.py of project's django-piston api: .... # "need" to set this for datetime.strftime() locale.setlocale(locale.LC_TIME,'de_AT.UTF-8') class ItemOverviewHandler(BaseHandler): ... @classmethod def…
fetzig
  • 1,642
  • 1
  • 13
  • 25
0
votes
1 answer

POSTing JPG|PNG along with JSON description with django-piston

I'm defining a create() method in django-piston. I need to be able to receive and image with its description enconded in JSON. How to do it? Shall they be processed in two separate HTTP requests?
0
votes
2 answers

django-piston : Overriding default serialization in emitters

I am currently writing an API for a django project, and using django-piston for this. However, I need to customize the way certain base types are serialized. More precisely, my models are subclassed from a special Model class, which inherits from…
sebpiq
  • 7,540
  • 9
  • 52
  • 69
0
votes
1 answer

Django Piston Content Type Always Null

I had django-piston working a week ago but recently I'm unable to call any web services. Below is a simple example. I have a 'test' service that returns 'yes' if there is a content type and 'no' if content type is null. I've done this because I get…
Przemek
  • 459
  • 7
  • 16
0
votes
1 answer

unusual django admin behavior when storing string values

Using django trunk r13359 and django piston, I created a small restful service that stores string values. This is the model I am using to store strings: class DataStore(models.Model): data = models.CharField(max_length=200) url =…
Up.
  • 959
  • 11
  • 20
0
votes
2 answers

"Invalid signature": oAuth provider with Django-piston

I'm working with django-piston to attempt to create an API that supports oAuth. I started out using the tutorial at: http://blog.carduner.net/2010/01/26/django-piston-and-oauth/ I added a consumer to piston's admin interface with key and secret both…
Martin Eve
  • 2,703
  • 1
  • 23
  • 23
0
votes
1 answer

Unable to HTTP PUT with libcurl to django-piston

I'm trying to PUT data using libcurl to mimic the command curl -u test:test -X PUT --data-binary @data.yaml "http://127.0.0.1:8000/foo/" which works correctly. My options look like: curl_easy_setopt(handle, CURLOPT_USERPWD,…
Jesse Beder
  • 33,081
  • 21
  • 109
  • 146
0
votes
2 answers

Django/piston + Silverlight, PUT/DELETE?

I am working on a Silverlight project that uses Django on the server using piston for the REST API. I understand that Silverlight doesn't support the PUT and DELETE http verbs. Is there another way i can pass these kinds of commands to piston?
Jason Miesionczek
  • 14,268
  • 17
  • 76
  • 108
0
votes
1 answer

Is django-piston compatible with Django 1.6.5?

We are using django-piston==0.2.3 with Django 1.4.12. We want to upgrade Django to 1.6.5. I tried to upgrade first to Django 1.5.8, but it's not compatible with piston 0.2.3. Is there a way to use Django 1.6.5 with piston? I noticed there is a fork,…
Uri
  • 2,992
  • 8
  • 43
  • 86
0
votes
1 answer

How to uninstall a package from bitbucket

I have install django-piston with pip by running: pip install -e hg+https://bitbucket.org/jespern/django-piston-oauth2#egg=django-piston-0.3dev Now I want to uninstall it, but running... pip uninstall -e…
Christoffer
  • 7,436
  • 4
  • 40
  • 42
0
votes
1 answer

Where do i put template that i want to render

The following is the code that i got from a website for basic-authentication using "django-piston". Here i have login.html page which i wana show,where do i put that and what is this realm keyword in the following code................. from…
0
votes
1 answer

Forms between Django Client and Django Piston API

Is there any easy way to process the ModalForm in Django Piston API to a Django Client? , On documentations @validate decorator is mentioning but I couldn't find the way to send forms from API to the Django Client. I feel like it is possible to use…
cem-
  • 83
  • 1
  • 8
0
votes
0 answers

Create objects from different models in one handler in Piston Django

I'm using Piston to create an API for an application in Django. I'll try to explain my doubt on an easy way. Let's think I've got two models: class Device(models.Model): id = models.TextField(...) class Person(models.Model): name =…
lluisu
  • 367
  • 1
  • 5
  • 19
0
votes
0 answers

Tastypie query limit

Is there any way to handle query per user limitations with tastypie API library ? I would like for example to limit all users to 200 queries per day. I looked all over the documentation and only found how to handle query results ranges…
Mibou
  • 936
  • 2
  • 13
  • 25
0
votes
1 answer

ImportError for Django Piston handler that isn't tied to a model

I have created a custom handler (CustomHandler) that isn't tied to a model in the ORM and I think it's rigged up correctly, but I'm getting an ImportError: cannot import CustomHandler when trying to import it into my resources.py. Here is my…
Gady
  • 4,935
  • 8
  • 38
  • 48
1 2 3
10
11