Add API endpoints to list, edit, and add data for ICEkit's Image model.
You can now access the images API at the web UI at /api/images/ when you are logged in as a user with sufficient permissions (either a super-user, or a user with change/add/delete model permissions for Image)
Use the new tokens admin at /admin/authtoken/token/ to generate opaque per-user authentication tokens, then include this token value in requests from clients outside a web browser context (i.e. which cannot or should not use standard session authentication)
Example curl commands to perform API operations with token authorisation (and assuming the token's associated user has sufficient permissions):
List Images: curl -X GET -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' http://icekit.lvh.me:8000/api/images/
Get details of a specific image PK=1: curl -X GET -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' http://icekit.lvh.me:8000/api/images/1/
Create an Image: curl -X POST -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' --form title='New image' --form image=@image_file.jpg http://icekit.lvh.me:8000/api/images/
Replace an image (must include image file data): curl -X PUT -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' --form title='Replaced image' --form image=@image_file.jpg http://icekit.lvh.me:8000/api/images/1/
Update an image (can be with partial changes, image file data need not be included): curl -X PATCH -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' --form title='Updated image' http://icekit.lvh.me:8000/api/images/1/
Coverage increased (+0.5%) to 73.136% when pulling 26266829f94912409d7e79c3ffa76c14b51f00c4 on 212-api-for-images-collection into 23b446c4e28d040ab7d23e7ff4b0a824b8b74267 on develop.
Add API endpoints to list, edit, and add data for ICEkit's Image model.
You can now access the images API at the web UI at /api/images/ when you are logged in as a user with sufficient permissions (either a super-user, or a user with change/add/delete model permissions for Image)
Use the new tokens admin at /admin/authtoken/token/ to generate opaque per-user authentication tokens, then include this token value in requests from clients outside a web browser context (i.e. which cannot or should not use standard session authentication)
Example curl commands to perform API operations with token authorisation (and assuming the token's associated user has sufficient permissions):
curl -X GET -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' http://icekit.lvh.me:8000/api/images/
curl -X GET -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' http://icekit.lvh.me:8000/api/images/1/
curl -X POST -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' --form title='New image' --form image=@image_file.jpg http://icekit.lvh.me:8000/api/images/
curl -X PUT -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' --form title='Replaced image' --form image=@image_file.jpg http://icekit.lvh.me:8000/api/images/1/
curl -X PATCH -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' --form title='Updated image' http://icekit.lvh.me:8000/api/images/1/
curl -X DELETE -H 'Authorization: Token 6c84357926bb0e3cb359e4b2e89ee7fa7c142731' http://icekit.lvh.me:8000/api/images/1/
Side-effects on GLAMkit as a result of this work include: