moved decorator to django-libs and fixed flake8 issues