adding functionality from python-tools to django-core