Compare commits
2 Commits
8a728f1568
...
851c85f4be
Author | SHA1 | Date |
---|---|---|
|
851c85f4be | |
|
a036e86b96 |
|
@ -0,0 +1,22 @@
|
|||
Django piston is pretty old and does not work with django1.11 out of the box.
|
||||
For the transition these are the changes required to get piston working
|
||||
|
||||
Start out by creating a new virtualenv, install the requirements, then change the following lines:
|
||||
|
||||
In piston/emitters.py:
|
||||
# instead of the original simplejson import
|
||||
import json as simplejson
|
||||
|
||||
# instead of the DateTimeAwareJsonEncoder import
|
||||
from django.core.serializers.json import DjangoJSONEncoder as DateTimeAwareJSONEncoder
|
||||
|
||||
# in ~186 replace the following line
|
||||
for f in data._meta.fields + data._meta.virtual_fields])
|
||||
# with this line
|
||||
for f in data._meta.fields + tuple(data._meta.virtual_fields)])
|
||||
|
||||
In piston/resource.py
|
||||
# in ~207 replace
|
||||
resp = HttpResponse(stream, mimetype=ct, status=status_code)
|
||||
# with this line
|
||||
resp = HttpResponse(stream, content_type=ct, status=status_code)
|
|
@ -1,5 +1,6 @@
|
|||
django==1.10
|
||||
django==1.11
|
||||
easy_thumbnails
|
||||
oauth
|
||||
django-auth-ldap
|
||||
django-restframework
|
||||
djangorestframework
|
||||
django-piston
|
||||
|
|
Loading…
Reference in New Issue