a bit modification for django-minipg