Refactored the Django backend for consistency.