piston

piston git support?

I found piston seems a decent tool for managing rails plugins, but when I try to do piston convert for my project with git based plugins, it just went dead completely and seems its trying to look for .svn with svn tools. I am on piston 1.4.0, is that git natively supported or I would have to build from edge? ...

Is it possible to use django Piston on Google AppEngine?

I haven't been able to do so due to all sort of missing dependencies (mainly, I think the problem is in the authentication code which relies on django stuff that is not available on AppEngine) I was wondering if anyone patched\forked piston to get it working on AppEngine? ...

Is Piston ready for OAuth?

I tried using Piston for a simple API, hoping to use its OAuth support. But the first time I hit the endpoint after enabling OAuth, I got an error: TemplateDoesNotExist: oauth/challenge.html and sure enough, there is no such file. Does OAuth work in Piston? Am I making a stupid n00b mistake? ...

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

Greetings, 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 sent correctly (i.e. that Primary key value doesn't exist yet). The problem is...

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. Finally, Ned Batchelder's question makes it look like a tutorial is in order. Thanks. ...

How do I force git to think a file is unmerged?

I want to make changes to a file in my repo, then force git to believe the file is unmerged and show up in git status like so: # Unmerged paths: # (use "git reset HEAD <file>..." to unstage) # (use "git add <file>..." to mark resolution) # # both modified: lib/delayed/recipes.rb # That's the entirety of my question. Rea...

Piston customize response representation

I am using piston and I would like to spit out a custom format for my response. My model is something like this: class Car(db.Model): name = models.CharField(max_length=256) color = models.CharField(max_length=256) Now when I issue a GET request to something like /api/cars/1/ I want to get a response like this: {'name' : 'BMW'...

Django Piston: How can I exclude nested fields from handler results? Is it even possible?

Before the question, the background: I am putting the finishing touches on an API I have written for a Django app utilizing django-piston. The API is able to search by request or IP address which are Request or IPAddress instances respectively. Each request can have 1 or more IPAddress associated with it. So, for example I have an API...

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

Hi guys! 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 areas in a building. The 'related_name' property for the FK is 'areas' so I can a...

python list mysteriously getting set to something within my django/piston handler

To start, I'm very new to python, let alone Django and Piston. Note: (I've updated this since the first two suggestions... you can view the old post in txt form here: http://bennyland.com/old-2554127.txt). The update I made was to better understand what was going wrong - and now I at least sort of know what's happening but I have no cl...

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, "test:test"); curl_easy_setopt(handle, CURLOPT_URL, "http://127.0.0.1:8000/foo/"); curl_easy_setopt(handle, CUR...

Making REST calls only available to local applications?

Suppose I have a url like http://mysite.com/get-users which returns a JSON object of all users. But, I don't want anyone (or any bots) to be able to go to this url to fetch this information. I want it to only respond to calls from other local modules in the same website. How would I go about implementing someting like this? ...

"Invalid signature": oAuth provider with Django-piston

Hi, 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 set to "abcd" for test purposes. The urls are successfully wired-up and the oAut...

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 = models.URLField(default = '', verify_exists=False, blank = True) I used curl to post following d...

basic http authentication with django-piston

Hi, I'm a newb to this. I've seen the code snippet at the official site (pasted below). The problem is how do I deploy this to the server ? Where do I set the username and password credentials ? In the httpd.conf file for Apache ? from django.conf.urls.defaults import * from piston.resource import Resource from piston.authentication ...

Django Piston issue - "oauth_user_auth() takes exactly 1 argument (2 given)"

I am having a few problems setting up Django Piston. I have managed to get as far as generating authentication via the oauth_client.py sample shown here (http://github.com/clemesha/django-piston-oauth-example). When I run "python oauth_client.py" i am taken to http://localhost:8000/api/oauth/authorize/?oauth_token=8wm33jeWR92BpsrHjs wher...

Complete 'django piston with oauth support' example

Hi, 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 examples: http://blog.carduner.net/2010/01/26/django-piston-and-oauth/ http://github.com/clemesha/django-piston-oauth-exampl...

Django-Piston - I Can't POST on a model with a ForeignKey

I'm trying to set up piston on my Django project. I ran into a brick wall when I tried to POST (create) a new entry on a model that contains a ForeignKey: location. Here is the exact error I receive: Cannot assign "u'1'": "Fest.location" must be a "Location" instance. In the above example, I tried to send over location=1 in the POST. ...