How c-edu-u/yango-kpi-master works
Main Components
• Django Project Core:
• YangoKpiMaster folder: Contains core configuration files (settings.py, urls.py, asgi.py, wsgi.py) and overall routing.
• manage.py: Entry point for running Django commands (migrations, server).
• Dashboard Application:
• The “dashboard” directory encapsulates the business logic, including models (Agent, WeeklyMetrics, QAEvaluation), views (for agents, weekly metrics, QA evaluations), forms, and templates.
• templates/dashboard: Provides the user-facing web pages (base layout, agents, weekly metrics, QA evaluations forms).
• Database:
• db.sqlite3 (development database used by Django for persisting data like agents, metrics, and evaluations).
• External Services & Dependencies:
• Python and Django runtime.
• Libraries such as openpyxl and pandas for processing XLSX files.
• Django Admin for internal management and data integrity.
Relationships and Interactions
• The Client/Browser interacts with the web server (Django) by navigating different endpoints (e.g., /agents, /weekly_metrics, /qa_evaluations).
• URL Routing:
• The project’s main urls.py delegates specific paths to the dashboard app’s urls.py.
• Request Flow:
• User requests hit views in the dashboard module which invoke forms processing and model interactions.
• Uploaded XLSX files are processed, data is validated, and then stored in the SQLite database.
• Administration:
• Django Admin (configured via admin.py in the dashboard app) provides a backdoor for managing records directly through a dedicated interface.
Architectural Patterns & Design Principles
• The application follows Django’s MVT (Model-View-Template) pattern:
• Model: Defined in dashboard/models.py.
• View: Handled in dashboard/views.py along with forms in dashboard/forms.py.
• Template: HTML templates within dashboard/templates/dashboard.
• Separation of Concerns:
• The split between the core (YangoKpiMaster) and the application-specific module (dashboard) emphasizes modularity.
• Data Integrity:
• Emphasis on linking agents, metrics, and evaluations ensures the data relationships are properly maintained.