Release Candidate passing my tests

101 views
Skip to first unread message

Rock

unread,
May 5, 2010, 8:14:35 PM5/5/10
to django-piston
I have been banging on 2.3rc1 (which is the current trunk) including
using a custom 'error_handler' function as well as the improved
'validate' decorator. FWIW I am using a recent django trunk (i.e.,
1.2ish) and python 2.6.4 on linux. It all looks good to me and so I
recommend an official 2.3 release based on the release candidate
unless, of course, somebody comes up with a good reason for holding
off.

Rock

--
You received this message because you are subscribed to the Google Groups "django-piston" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-pisto...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-piston?hl=en.

jespern

unread,
May 7, 2010, 6:42:37 AM5/7/10
to django-piston
Hi Rock,

There are a couple of things I'd like to include before going for a
0.2.3 release.

* Pagination
* Some content-type fixes
* The error handling stuff from Matt

I'd like to get these in, and then do a release. Unfortunately, I
haven't had time to do it yet :-(


Jesper

Mario Gonzalez

unread,
Jun 3, 2010, 10:38:37 PM6/3/10
to django-piston
On May 7, 6:42 am, jespern <jno...@gmail.com> wrote:
> Hi Rock,
>
> There are a couple of things I'd like to include before going for a
> 0.2.3 release.
>

I haven't seen much movements here, sorry if I'm wrong. In my work I
need to use Pagination so, if anyone is taking care of this point I'd
like to help writing the needed lines.

Jespern, or anyone in the "core team", what do you think?

Joe Banafato

unread,
Jun 4, 2010, 1:56:43 AM6/4/10
to django...@googlegroups.com
Mario,

It's not strictly pagination--it's record-based partial get--but this
is what I use for that purpose:
http://bitbucket.org/joeb/django-piston/

If it's useful enough to go upstream I'd support/enhance it. Right
now it does everything I need it to do.

Joe

Mario Gonzalez

unread,
Jun 6, 2010, 7:36:52 PM6/6/10
to django...@googlegroups.com
On 4 June 2010 01:56, Joe Banafato <j...@banafato.com> wrote:
> Mario,
>
> It's not strictly pagination--it's record-based partial get--but this
> is what I use for that purpose:
> http://bitbucket.org/joeb/django-piston/
>

What would the answer be in this case?

piston/resource.py, L234
range = "records %i-%i/%i" % (start, end, count)

is count (L232) in a inverted way to respect L233?

> If it's useful enough to go upstream I'd support/enhance it.  Right
> now it does everything I need it to do.
>

Thanks for this job, I'd really like to enhance it to be merge into
main branch. (I'm used to git, what's the main branch's name in
mercurial?)

--
http://www.mgonzalez.cl/
http://twitter.com/gonzalemario

Mario Gonzalez

unread,
Jun 8, 2010, 2:44:31 PM6/8/10
to django...@googlegroups.com
On 7 May 2010 06:42, jespern <jno...@gmail.com> wrote:
> Hi Rock,
>
> There are a couple of things I'd like to include before going for a
> 0.2.3 release.
>
>  * Pagination
>  * Some content-type fixes
>  * The error handling stuff from Matt
>
> I'd like to get these in, and then do a release. Unfortunately, I
> haven't had time to do it yet :-(
>

Joe Banafato has done some work related to Pagination using the
Partial Get statement. (discussed in this thread) What do you need to
be merged into the main branch?

>
> Jesper
>
> On May 6, 3:14 am, Rock <rockmhow...@gmail.com> wrote:
>> I have been banging on 2.3rc1 (which is the current trunk) including
>> using a custom 'error_handler' function as well as the improved
>> 'validate' decorator. FWIW I am using a recent django trunk (i.e.,
>> 1.2ish) and python 2.6.4 on linux. It all looks good to me and so I
>> recommend an official 2.3 release based on the release candidate
>> unless, of course, somebody comes up with a good reason for holding
>> off.
>>
>> Rock
>>
>> --
>> You received this message because you are subscribed to the Google Groups "django-piston" group.
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to django-pisto...@googlegroups.com.
>> For more options, visit this group athttp://groups.google.com/group/django-piston?hl=en.
>

--
http://www.mgonzalez.cl/
http://twitter.com/gonzalemario

Fabian Sturm

unread,
Jun 8, 2010, 3:22:23 PM6/8/10
to django-piston
Hi!

One thing I would like to be fixed, would be the broken blogpost
example.
The url mapping is missing a (?P<title>.*) or the handler needs to be
modified to work correctly.
It was e.g. discussed here:
http://groups.google.com/group/django-piston/browse_thread/thread/664d06c130386202/0839c7387b1217fb?lnk=gst&q=title#0839c7387b1217fb

Thank a lot, Fabian

Sebastian

unread,
Jul 3, 2010, 3:33:09 PM7/3/10
to django-piston
Hi Jesper,

On May 7, 12:42 pm, jespern <jno...@gmail.com> wrote:
> Hi Rock,
>
> There are a couple of things I'd like to include before going for a
> 0.2.3 release.
>
>  * Pagination
>  * Some content-type fixes
>  * The error handling stuff from Matt

Why dont you make a 0.2.3 release and add this features to 0.2.4 or
0.2.5?

This would make a lot of things easier for us. Installing the current
django-piston in an automated deployment with pip via hg from a
requirements file is very slow and installing from local zip file is
not yet possible with pip. it is 13 month since the last release...
please, make a new release with all the great new features and
bugfixes!

Sebastian

HenningS

unread,
Jul 23, 2010, 3:52:21 AM7/23/10
to django-piston
Hi,

i would also appreciate a small release now, and another later.


Please keep going!

Regards,

Henning

Rock

unread,
Jul 26, 2010, 4:03:29 PM7/26/10
to django-piston
I have to concur that I am getting rather desperate for a 2.3 release
right now. Go J go!

jespern

unread,
Jul 27, 2010, 5:08:18 AM7/27/10
to django-piston
I get it. Everyone here and at ~every conf I've frequented the last 6
months wants a release. And you'll get one.

Thomas Johanson has been working hard on refactoring our oauth
implementation to use the excellent python-oauth2 library, and I want
this in before 0.3 is out.

It's supposed to be backwards compatible. I don't know how many of you
use oauth in piston currently, but I'd very much appreciate any
testing people could do. Also, running your API under Thomas' fork,
making sure everything still works would be great.

http://bitbucket.org/prencher/django-piston

Let's get this merged in, and 0.3 will hit the streets.


Jesper
> > > > > You received this message because you are subscribed to the Google Groups "django-piston" group.> > > > To post to this group, send email todjang...@googlegroups.com.> > > > To unsubscribe from this group, send email todjango-pist...@googlegroups.com.
> > > > > For more options, visit this group athttp://groups.google.com/group/django-piston?hl=en.
>
> > > > --
> > > > You received this message because you are subscribed to the Google Groups "django-piston" group.> > > To post to this group, send email todjang...@googlegroups.com.> > > To unsubscribe from this group, send email todjango-pist...@googlegroups.com.

Thomas Johansson

unread,
Jul 27, 2010, 10:23:26 AM7/27/10
to django...@googlegroups.com
I should clarify jespern's comment about compatibility: It's data compatible, not code compatible. There are various reasons for this, most of which have to do with moving on top of python-oauth2 which doesn't have a store, and not wanting to carry forward bad design decisions in the original oauth.py.

To update your code to use it:

- If you're using a custom store, you'll need to implement a new one based on the API laid out in piston.authentication.oauth.store and point the PISTON_OAUTH_STORE at it.

- You'll need to update your URL patterns to remove use of oauth_request_token, oauth_user_auth and oauth_access_token, and replace them with the views provided in piston.authentication.oauth.views; There is also a piston.authentication.oauth.urls provided for convenience.

- The OAuthAuthentication store is now located in piston.authentication.oauth, so that import will need updating.

- If your client is using OAuth 1.0, it will need to be updated to use OAuth 1.0a. Due to the major security flaw in 1.0, it is not supported in the new implementation of piston's OAuth support.

- Finally, Piston 0.3 will require Django 1.2. This decision was made by jespern, and my fork assumes this to be the case.

That should be all you need to do. Please let me know how it works for you.

- Tom

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-pisto...@googlegroups.com.

Thomas Johansson

unread,
Jul 27, 2010, 10:29:09 AM7/27/10
to django...@googlegroups.com
Addendum:

- authorize_request_token by default uses templates piston/oauth/authorize.html and piston/oauth/authorize_verification_code.html.

- The challenge template for OAuthAuthentication is looked for at piston/oauth/challenge.html.

The tests/test_project has examples of these and the URL patterns.

- Tom

BozeWolf

unread,
Aug 2, 2010, 7:55:12 PM8/2/10
to django-piston
It looks nice, but I can't get it to work... I got oauth 1 working,
after altering the original code.
Oauth2 is a bit harder. A working example (like [1]) would be nice.
I also think i've found a bug; in piston/authentication/auth/
utils.py:L52, I changed/ugly hacked:

missing = list(param for param in params if param not in
oauth_request)

To this:

try:
missing = list(param for param in params if param not in
oauth_request)
except:
missing = params

I discovered this when I tried to run the example project within mine.
Params was not iterable.

[1] http://github.com/clemesha/django-piston-oauth-example/blob/master/oauth_client.py

Roel

On Jul 27, 4:29 pm, Thomas Johansson <prenc...@gmail.com> wrote:
> Addendum:
>
> - authorize_request_token by default uses templates
> piston/oauth/authorize.html and
> piston/oauth/authorize_verification_code.html.
>
> - The challenge template for OAuthAuthentication is looked for at
> piston/oauth/challenge.html.
>
> The tests/test_project has examples of these and the URL patterns.
>
> - Tom
>
> >> group, send email todjango-pist...@googlegroups.com<todjango-piston%2Bunsu...@googlegroups.com>
> >> .
> >> > > > > > For more options, visit this group athttp://
> >> groups.google.com/group/django-piston?hl=en.
>
> >> > > > > --
> >> > > > > You received this message because you are subscribed to the Google
> >> Groups "django-piston" group.> > > To post to this group, send email
> >> todjang...@googlegroups.com.> > > To unsubscribe from this group,
> >> send email todjango-pist...@googlegroups.com<todjango-piston%2Bunsu...@googlegroups.com>
> >> .
> >> > > > > For more options, visit this group athttp://
> >> groups.google.com/group/django-piston?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "django-piston" group.
> >> To post to this group, send email to django...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> django-pisto...@googlegroups.com<django-piston%2Bunsu...@googlegroups.com>
> >> .

Thomas Johansson

unread,
Aug 5, 2010, 5:55:48 AM8/5/10
to django...@googlegroups.com
On 3 August 2010 01:55, BozeWolf <sterkw...@gmail.com> wrote:
It looks nice, but I can't get it to work... I got oauth 1 working,
after altering the original code.
Oauth2 is a bit harder. A working example (like [1]) would be nice.

The test_project in tests/ functions as the example. The blogserver example doesn't make use of OAuth at all (perhaps worth doing).

Did you update your project's OAuth URLs to use the new views in piston.authentication.oauth.views, or include piston.authentication.oauth.urls and update client apps accordingly?
Did you make sure your client is using OAuth 1.0a and not 1.0? 1.0 is no longer supported for security reasons.
Did you change the authentication to the new OAuthAuthentication from piston.authentication.oauth? It is no longer in piston.authentication due to python-oauth2 being an optional dependency.

The new implementation is data compatible, not code compatible, although the code changes you need to do should be minor, unless you have your own store implementation.
 
I also think i've found a bug; in piston/authentication/auth/
utils.py:L52, I changed/ugly hacked:

missing = list(param for param in params if param not in
oauth_request)

To this:

try:
   missing = list(param for param in params if param not in
oauth_request)
except:
   missing = params

I discovered this when I tried to run the example project within mine.
Params was not iterable.

I'm not sure why you would get that error - params is a simple list, extended with the sequence passed in via the parameters argument. Perhaps it is an issue with an older version of Python? Which version are you using?

- Tom

Liam Kirsher

unread,
Aug 5, 2010, 11:58:53 AM8/5/10
to django...@googlegroups.com
See comment below...
I was getting this error as well, and meant to ask about it, but got pulled away on another project.  I'll see if the workaround works for me.


- Tom

--
You received this message because you are subscribed to the Google Groups "django-piston" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-pisto...@googlegroups.com.

Thomas Johansson

unread,
Aug 5, 2010, 3:01:45 PM8/5/10
to django...@googlegroups.com
Can you provide the stacktrace when it happens? I can't reproduce this on any Python version going back to 2.4.

Liam Kirsher

unread,
Aug 6, 2010, 1:31:44 PM8/6/10
to django-piston
Thomas,

Here is the stacktrace I get. Please keep in mind I may have
(probably have) misconfigured something and/or don' t quite understand
how it is supposed to work. I'm expecting to get back a token when I
access that url
URL: http://localhost:8000/api_2.0/oauth/get_request_token

http://dpaste.com/225679/

I've been trying to test using the following test script that I found
someplace --
http://dpaste.com/225686/

The server prints out the actual request which looks like this:
[06/Aug/2010 10:21:21] "GET /api_2.0/oauth/get_request_token/?
oauth_nonce=47503791&oauth_timestamp=1281115281&oauth_consumer_key=lkjlkjlkj&oauth_signature_method=HMAC-
SHA1&oauth_version=1.0&oauth_signature=U39N7np5ZEbphjRXjmNw7Mm%2FYLI
%3D HTTP/1.1" 400 40

I see that the &oauth_version=1.0, and I recall that 1.0a is required,
but I'm not clear where exactly to get that, and how that is related
to oauth2, which is what is being imported.

I have entered the (actual) key and secret in the database via the
admin facility.

Thanks for your help!

Liam


On Aug 5, 12:01 pm, Thomas Johansson <prenc...@gmail.com> wrote:
> Can you provide the stacktrace when it happens? I can't reproduce this on
> any Python version going back to 2.4.
>
> On 5 August 2010 17:58, Liam Kirsher <l...@hearplanet.com> wrote:
>
> >  See comment below...
>
> > Thomas Johansson wrote:
>
> > django-pisto...@googlegroups.com<django-piston%2Bunsu...@googlegroups.com>
> > .

Thomas Johansson

unread,
Aug 8, 2010, 9:16:56 PM8/8/10
to django...@googlegroups.com
From what you pasted, you are getting the correct response, which is a 400 bad request.

That happens because you're making a 1.0 request with that client, rather than a 1.0a request. With 1.0a, the client must pass the callback via oauth_callback to get_request_token, or if no callback is provided, instead pass "oob". More details on that here: http://mojodna.net/2009/05/20/an-idiots-guide-to-oauth-10a.html.

As far as the exception, that is a separate issue and I really don't understand why it is happening, nor can I reproduce it locally. I modified the included tests to throw all sorts of wrong parameters at it, and it just gives the correct response, that is, a 400 with a list of missing parameters, no exception. If you can provide any more specific details that'd be a great help.

- Tom
Reply all
Reply to author
Forward
0 new messages