Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

unexpected keyword argument 'write_only' #19

Closed
ghost opened this issue May 15, 2014 · 9 comments
Closed

unexpected keyword argument 'write_only' #19

ghost opened this issue May 15, 2014 · 9 comments

Comments

@ghost
Copy link

ghost commented May 15, 2014

When adding

url(r'^api-token-auth/', 'rest_framework_jwt.views.obtain_jwt_token'),

to my urls, as specified in the doc, I get

File "/xxx/local/lib/python2.7/site-packages/rest_framework_jwt/views.py" in

  1. from .serializers import JSONWebTokenSerializer
    File "/xxx/local/lib/python2.7/site-packages/rest_framework_jwt/serializers.py" in
  2. class JSONWebTokenSerializer(serializers.Serializer):
    File "/xxx/local/lib/python2.7/site-packages/rest_framework_jwt/serializers.py" in JSONWebTokenSerializer
  3. password = serializers.CharField(write_only=True)
    
    File "/xxx/local/lib/python2.7/site-packages/rest_framework/fields.py" in init
  4.     super(CharField, self).**init**(_args, *_kwargs)
    
    Exception Type: TypeError at /
    Exception Value: init() got an unexpected keyword argument 'write_only'
@Hunsu
Copy link

Hunsu commented May 25, 2014

I have got this even it worked the first time. So I decided to reinstall the framework and it worked again.

@jpadilla
Copy link
Owner

@julj @Hunsu what version of DRF are you using? Have you been able to reproduce this?

@Hunsu
Copy link

Hunsu commented May 25, 2014

I'm using djangorestframework 2.3.13.

@ghost
Copy link
Author

ghost commented May 26, 2014

I'm using djangorestframework 2.3.10.

@jpadilla
Copy link
Owner

@julj any way you could include a failing test for this? It will help greatly to debug and fix this issue.

@Hunsu
Copy link

Hunsu commented May 27, 2014

It's the code you gave on the documentation. I have everything as it the documentation and I have got the error.

@stanhu
Copy link
Contributor

stanhu commented May 27, 2014

django-rest-framework 2.3.11 added the write_only field (encode/django-rest-framework#1306). I think we need to bump requirements.txt to mandate 2.3.11.

stanhu pushed a commit to stanhu/django-rest-framework-jwt that referenced this issue May 27, 2014
@jpadilla
Copy link
Owner

@stanhu thank you so much for this

@jpadilla
Copy link
Owner

Released 0.1.5 which contains PR #20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants