Update django_up.py

refactoring