How julioherrera15/ipc2_proyecto3_202300850 works
Project Type and Purpose
• This is a monolithic, server‐rendered web application built with Django (Python).
• The top‐level “Proyecto3” folder contains the Django project settings, URLs, ASGI/WSGI entry points, and the SQLite database.
• The “app” folder is a single Django application module: it holds models, views, URLs, templates, migrations, forms, and a file‐based session store.
File Structure and Architectural Patterns
• Top‐Level
• manage.py – CLI entry for migrations, dev server, etc.
• Proyecto3/ – Django project settings & routers:
– settings.py, urls.py, asgi.py, wsgi.py
• db.sqlite3 – SQLite persistent store
• app/
• models.py – ORM definitions → maps to SQLite
• views.py & urls.py – Controller layer (Django’s MTV)
• templates/ – Jinja2/Markup views for client
• forms.py – Request‐validation layer
• migrations/ – Schema evolution
• flask_session/ – File‐based session store (configured in settings.py)
• Testing & Admin
• tests.py, admin.py
Key Components
a. Client Browser
– Sends HTTP(S) requests; receives HTML responses.
b. Web Server / Application Server
– ASGI or WSGI server (e.g., Daphne, Gunicorn) hosting the Django app.
c. Django Framework
– URL Dispatcher (Proyecto3/urls.py + app/urls.py)
– Middleware (session engine)
– Views (app/views.py)
– Forms & Validation (app/forms.py)
– Template Engine (app/templates)
– ORM & Models (app/models.py)
d. Data Stores
– SQLite Database (db.sqlite3)
– File‐based Session Store (app/flask_session/)
e. Management & Maintenance
– manage.py for running migrations & dev server
– Migrations subsystem (app/migrations/)
Component Relationships & Data Flows
• Browser → HTTP Request → ASGI/WSGI Server
• Server → Django URL Resolver → Matching app URL
• URL → View Function →
• If form data: pass through forms.py for validation
• Business logic in views → models via ORM
• Read/write session data in flask_session folder
• Query/update SQLite via Django ORM
• View → Render Template → HTML Response → Browser
Architectural Patterns & Design Principles
• Monolithic MVC (MTV in Django terms)
• Single codebase; shared database & session store
• Server‐side rendering; minimal client‐side logic
• File‐based sessions for stateful interactions
Technologies & Frameworks to Annotate
• Python 3 + Django
• ASGI/WSGI server (Daphne/Gunicorn)
• SQLite (built‐in)
• Django Template Language (DTL)
• Django ORM & Migrations
• File‐based Session Backend
Elements
• From Browser → ASGI/WSGI → URL Dispatcher → View → ORM → DB
• From View → Template Engine → Browser