adding fix for manage.py and refactoring the template base