# WARP.md This file provides guidance to WARP (warp.dev) when working with code in this repository. ## Project Overview This is a Django-based Digital Branding Management System designed to help manage content creation and publication across multiple digital platforms. The system tracks platforms, content deliverables, and strategies with comprehensive admin functionality. ## Architecture ### Core Models & Relationships The application is built around three main models with clear relationships: - **Platform**: Represents social media/content platforms (LinkedIn, YouTube, Blog, etc.) - Has many ContentDeliverable and Strategy records - Includes completion rate calculations and status tracking - **ContentDeliverable**: Individual content items with progress tracking - Belongs to a Platform - Tracks status progression: committed → drafted → published - Includes due date tracking and overdue detection - **Strategy**: Platform-specific strategic objectives and tactics - Belongs to a Platform - Follows OTAC structure (Objective, Tactics, Actions, Control) - Has priority levels and active/inactive states ### Application Structure ``` digital-branding-system/ ├── branding_system/ # Django project settings ├── dashboard/ # Main app with models, views, admin ├── templates/ # HTML templates with Tailwind CSS ├── static/ # Static files └── manage.py # Django management script ``` ## Development Commands ### Environment Setup ```bash # Activate virtual environment source venv/bin/activate # Install dependencies (if requirements.txt is created) pip install -r requirements.txt ``` ### Django Management ```bash # Run development server python manage.py runserver # Database operations python manage.py makemigrations python manage.py migrate python manage.py createsuperuser # Testing python manage.py test python manage.py test dashboard # Database shell and management python manage.py shell python manage.py shell_plus # Enhanced shell via django-extensions python manage.py dbshell ``` ### Django Extensions Commands The project uses django-extensions which provides additional helpful commands: ```bash # Show URL patterns python manage.py show_urls # Generate model graphs python manage.py graph_models -a -o models.png # Reset database (development only) python manage.py reset_db # Export data as Python script python manage.py dumpscript dashboard > backup_data.py # Show all available commands python manage.py help ``` ### Data Management ```bash # Create sample data via admin interface at /admin/ # Default admin is accessible once superuser is created # Export/import data python manage.py dumpdata dashboard > dashboard_data.json python manage.py loaddata dashboard_data.json ``` ## Key Features ### Admin Interface Customizations - Comprehensive admin interface with custom displays and filters - Color-coded status indicators and progress bars - Bulk actions for status changes - Custom admin site branding: "Digital Branding Management System" ### Dashboard Views - Main dashboard with platform overview cards - Platform-specific detail views - Real-time completion rate calculations - Overdue content tracking ### Model Properties & Methods Models include calculated properties for: - Completion rates and counts by status - Overdue detection and days until due - Total deliverable counts per platform ## Database Schema Notes ### Current Setup - Uses SQLite database (`db.sqlite3`) - Includes Django REST Framework (though no API endpoints are currently defined) - Models use standard Django field types with proper relationships ### Important Field Validations - Priority levels: 1-5 scale (1 = highest priority) - Completion percentage: 0-100% validation - Status choices are enforced at model level - Date validations for target vs actual dates ## Styling & Frontend ### CSS Framework - Uses Tailwind CSS via CDN - Custom color scheme defined: - brand-blue (#3B82F6) - brand-green (#10B981) - brand-orange (#F59E0B) - brand-red (#EF4444) - brand-purple (#8B5CF6) ### Template Structure - Base template with navigation and common styling - Dashboard template extends base template - Font Awesome icons integrated ## Testing & Development ### Test Structure - Basic test framework is in place (`dashboard/tests.py`) - Tests should be added for models, views, and admin functionality ### Development Workflow 1. Activate virtual environment 2. Run migrations if needed 3. Start development server 4. Access admin interface for data management 5. View dashboard at root URL ## Deployment Considerations ### Security Settings - SECRET_KEY is currently hardcoded (should be moved to environment variable) - DEBUG=True (should be False in production) - ALLOWED_HOSTS is empty (needs to be configured for production) ### Static Files - Static files configured for development - STATIC_ROOT set to 'staticfiles' for production collection ### Database - Currently uses SQLite (consider PostgreSQL for production) - Database migrations are tracked in dashboard/migrations/ ## URL Structure - `/` - Main dashboard - `/admin/` - Django admin interface - `/platform//` - Platform detail view ## Dependencies Key packages: - Django 5.2.6 - django-extensions 4.1 - djangorestframework 3.16.1