Skip to content

Refactor manage.py with Environment Support & LoggingΒ #52

Description

@rajnil9

✨ Feature Description

πŸ“„ Description

This PR improves Django's manage.py utility by introducing environment-aware settings, .env support, and better error handling.
It makes development and production configuration cleaner, more extensible, and contributor-friendly.

🎯 Problem Statement

The existing manage.py script lacked enhanced error handling, clear documentation, and environment flexibility. This could lead to confusion when Django wasn’t installed, when the virtual environment was inactive, or when contributors tried running commands in different environments. The updated script improves maintainability, debugging, and onboarding for new developers.

πŸ’‘ Proposed Solution

βœ… Changes Made

Added .env support via python-dotenv
Enabled dynamic settings switching (development.py, production.py)
Improved error handling with clear logging
Added environment-based settings auto-selection (ENV=development/production)
Maintained backward compatibility with existing manage.py commands

🧩 Component

Backend (Django/API)

πŸ”₯ Priority

High - Important for my use case

πŸŽͺ Use Case

Developers need a reliable entry point (manage.py) to run Django administrative commands like migrations, server start, superuser creation, and app management. A cleaner and more robust script ensures consistent behavior across environments (development, staging, production).

πŸ”„ Alternatives Considered

No response

🎨 Mockups/Examples

No response

πŸ“‹ Additional Context

No response

Metadata

Metadata

Labels

IntermediateModerate difficulty, requires some skillOSCI'25Open Source Connect India 2025 projectenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions