Repository Root
Documentation (/docs)
Documentation Structure
Documentation Structure
ESP Django Project (/esp)
This is the heart of the application.
Root Level (/esp)
Main Django management script. Run
./manage.py <command> for:runserver- Start development servershell_plus- Enhanced Python shellmigrate- Apply database migrationstest- Run test suitecreatesuperuser- Create admin account
Python dependencies including:
- Django 2.2.28
- PostgreSQL adapter (psycopg2)
- Memcached client (pylibmc)
- Payment processors (Stripe)
- Communication (Twilio, SendGrid)
Python Package (/esp/esp)
Every directory from here requires an __init__.py file.
Program App (/esp/esp/program) ⭐
Contains most of the site’s logic.
Program Modules are the core extensibility mechanism. Each module (like
StudentRegCore or TeacherBioModule) handles a specific workflow. Modules are stored in handlers/<name>module.py.See the Program Modules documentation for details.Program Module Handlers
Thehandlers/ directory contains 70+ module files:
Student Modules (learn)
Student Modules (learn)
studentregcore.py- Main student registration pagestudentclassregmodule.py- Class selection interfacestudentregtwophase.py- Two-phase lottery registrationlotterystudentregmodule.py- Priority lotteryfinancialaidappmodule.py- Financial aid applicationsstudentonsite.py- Onsite student features- And 15+ more…
Teacher Modules (teach)
Teacher Modules (teach)
teacherregcore.py- Main teacher registration pageteacherclassregmodule.py- Class creation/editingteacherbiomodule.py- Teacher biography submissionavailabilitymodule.py- Teacher availabilityteacheronsite.py- Onsite teacher features- And 10+ more…
Admin Modules (manage)
Admin Modules (manage)
admincore.py- Admin dashboard and settingsadminclass.py- Class review and approvalajaxschedulingmodule.py- Manual scheduling interfaceautoschedulerfrontendmodule.py- Automatic schedulercommmodule.py- Email communicationslistgenmodule.py- User list generation- And 30+ more…
Onsite Modules (onsite)
Onsite Modules (onsite)
onsitecore.py- Onsite landing pageonsitecheckinmodule.py- Student check-inonsiteregister.py- Walk-in registrationteachercheckinmodule.py- Teacher check-in- And 10+ more…
Users App (/esp/esp/users) ⭐
ESPUser- Proxy model extending Django’s User with methods for students/teachersPermission- Fine-grained access controlRecord- Tracks user completion of requirementsContactInfo- Phone numbers and addressesStudentInfo- Student-specific data (grade, school)TeacherInfo- Teacher-specific data (MIT affiliation, etc.)
Other Important Apps
Accounting (/esp/esp/accounting)
Accounting (/esp/esp/accounting)
Payment processing and financial tracking.Key Models:
LineItemType- Types of charges (program fee, lunch, etc.)Transfer- Payment recordsFinancialAidRequest- Financial aid applicationsFinancialAidGrant- Aid approvals
- Stripe and CyberSource payment integration
- Accounting reports
- Financial aid workflow
Resources (/esp/esp/resources)
Resources (/esp/esp/resources)
Classroom and equipment management.Key Models:
ResourceType- Categories (classroom, projector, etc.)Resource- Individual resources with capacityResourceRequest- Classes requesting resourcesResourceAssignment- Assigned resources
The resources system is being redesigned. Current implementation can be complex.
Calendar (/esp/esp/cal)
Calendar (/esp/esp/cal)
Time blocks and event scheduling.Key Models:
Event- Time blocks for class sectionsEventType- Categories (Class Time, Lunch, etc.)
QSD (/esp/esp/qsd)
QSD (/esp/esp/qsd)
Quasi-Static Data - admin-editable page content.Key Models:Administrators can edit this content at
QuasiStaticData- Content blocks with versioning
/admin/qsd/quasistaticdata/.Tagdict (/esp/esp/tagdict)
Tagdict (/esp/esp/tagdict)
Flexible key-value configuration system.Key Models:
Tag- Configuration values scoped to programs or global
Dbmail (/esp/esp/dbmail)
Dbmail (/esp/esp/dbmail)
Email queue and delivery system.Key Models:
MessageRequest- Email send requestsTextOfEmail- Email contentEmailList- Mailing list routing
Customforms (/esp/esp/customforms)
Customforms (/esp/esp/customforms)
Form builder for custom data collection.Usage: Create forms at
/customforms/, embed in registration via tags.Themes (/esp/esp/themes)
Themes (/esp/esp/themes)
Site theming and branding system.Features:
- Theme selection (barebones, circles, fruitsalad, etc.)
- Color customization
- Logo and image management
- Template override generation
Static Files (/esp/public)
- Development: Django’s
runserverserves frompublic/media/ - Production: Apache serves directly from filesystem
- File path
/esp/public/media/scripts/foo.js→ URL/media/scripts/foo.js
Templates (/esp/templates)
Deployment (/deploy)
Useful Scripts (/esp/useful_scripts)
Finding What You Need
Looking for a model?
Check
esp/esp/{app}/models.py or models/__init__.pyExample: Program is in esp/esp/program/models/__init__.pyLooking for a view?
Check
esp/esp/{app}/views.py or for program modules, esp/esp/program/modules/handlers/{module}module.pyExample: Student registration is in esp/esp/program/modules/handlers/studentregcore.pyLooking for a template?
Check
esp/templates/{app}/ or esp/templates/program/modules/{module}/Example: Student reg template is in esp/templates/program/modules/studentregcore/Next Steps
Architecture
Understand the system design
Models Reference
Learn about data models
Program Modules
Explore the module system
Contributing
Start contributing code