Django

Hidden gems of Django: Truncator

Turns out Django offers great way to truncate text. Lets see how to use the built-in util Truncator.

Django

How to select random record with Django ORM

This post details how I solved displaying random banner on this very site. The solution does not have any prerequisites.

Django

How to automatically switch debug/production database in settings.py in Django

Since settings.py is just an ordinary Python file we can use simple `if else` block.

Django

How to display fractions in Django

Short post about rendering for example 1/4, 1/2 and other fractions in your Django template. Turns out this is not complicated if you know about important parts to combine.

Django

How to create RSS feed with HTML content in Django

Presenting my solution which I arrived at with trial & error in hopes it could save time to someone.

Django

How to create/register user account with Django Rest Framework API

My solution for account registration with DRF.

Django

Django: How to send image file as part of response

Using Base64 might be useful in some scenarios.

Django

Django Rest Framework: How to let user add only one ForeignKey object (for example review)

My solution I decided to write up to have reference in the future.

Django

Django: How to let user re-order/sort table of content with drag and drop

I needed to preserver order of table elements and decided to share my solution.

Django