djangosnippets.org: Latest snippets tagged with 'rest-api'https://djangosnippets.org/tags/rest-api/2018-05-18T11:42:14.426508-05:00DRF - Optimizing ModelViewSet queries
2018-05-18T11:42:14.426508-05:00jackton1https://djangosnippets.org/snippets/10647/<p>Using Django REST Framework for Model views there is always the issue of making duplicated queries without either prefetching the objects that will be accessed using the serializer and as such will lead to large number of queries being made to the database.</p>
<p>This will help in optimizing the queryset …</p>
Freely redistributableBit.ly url shortener
2010-11-29T15:34:33.996615-06:00BluePeppershttps://djangosnippets.org/snippets/2280/<p>A small function to convert a url to another shortened via the bit.ly service. Requires a username and password in django settings.
</p>
Freely redistributable