Using RedirectView in urls.py

Posted on Sat 30 January 2016 in Web Development • Tagged with Django0 Comments

Django's RedirectView is a generic Class-based View (or CBV for short) that is handy whenever you need to implement redirects. It's especially handy in urls.py for simple use cases where you don't need conditional redirects or any other business logic. In this post, I will explore a use cases when you can use the view directly in the urls.py module.

Continue reading

Django admin inlines and custom form arguments

Posted on Sun 15 November 2015 in Web Development • Tagged with Django, Django Admin0 Comments

Django admin inlines are a quick and convenient way to embed related objects into a django admin detail page. All is great until you need a custom form to handle the edits for the related objects, that in turn need custom arguments to be passed to the form constructor. In the following post, I'll describe a possible solution to this problem.

Continue reading

Django REST Framework upgrade from 2 to 3

Posted on Sun 30 August 2015 in Web Development • Tagged with Django, Django-REST-framework, API, REST0 Comments

Upgrading project dependencies always involves risk, especially if they have a lot of backward incompatible changes. About one year ago, Django REST Framework (DRF for short) started a big redesign project intended to bring improved design, maintainability and debugging capabilities. Unfortunately this redesign implies a lot of backward incompatible changes. This article will present our approach of upgrading DRF and hopefully will help you efficiently plan your's.

Continue reading