whats the best way to encode/hash url ids in django 1.11

Viewed 54

I'm trying to migrate our project that uses incremental ids for our APIs to use encoded or hashed ids. The problem is we're using Django 1.11 that doesn't support url converters which will be very helpful for implementing this feature. But..

Upgrading Django is not an option for us (too risky!)

the only viable option I'm considering is to use Django middleware and write our own middleware that will do the transformation for us (but this seems a very ugly solution because modifying original request info is just meh)

If possible, we also avoid directly changing it to viewsets level So before it actually reach the viewsets methods, ids should have decoded.

What is the best implementation and solution for this? thanks!

0 Answers
Related