Stores the codebase for the blowcomotion.org website
Live Site: https://blowcomotion.org
Template Demo: https://themewagon.github.io/Djoz/index.html
The templates for this codebase are derived from the Djoz theme
This is a Django + Wagtail CMS project with a hybrid app layout:
blowcomotion— CMS core: Wagtail admin wiring, StreamField blocks, the public form pipeline, settings, root URLs, base templates, and all models (inblowcomotion/models/)gigs,attendance,charts,instruments,members— domain apps holding views, forms, URLs, templates, tests, and management commands for their domain
Models live centrally in blowcomotion/models/, not in the domain apps that use them. This is legacy from the #312 hybrid-app split: at the time, moving models into their own apps would have required SeparateDatabaseAndState migrations and Wagtail content-type surgery on live production data, for no real benefit (the domains are FK-entangled anyway). So gigs, attendance, charts, instruments, and members must not gain a models.py or migrations/ of their own — new models for those domains go in blowcomotion/models/.
Going forward, new apps for genuinely new domains are not bound by that constraint — since there's no existing production data to migrate around, a new domain app can define its own models.py and own its own tables like a normal Django app.
-
Clone the repository
git clone <repository-url>
-
Navigate to the project directory
cd blowcomotion.org -
Create a virtual environment
python -m venv venv
-
Activate the virtual environment
Windows
venv\Scripts\activate
macOS/Linux
source venv/bin/activate -
Install the required packages
pip install -r requirements.txt
-
Install isort for import sorting
pip install isort
-
Run database migrations
python manage.py migrate
-
Create a superuser account
python manage.py createsuperuser
This project includes a pre-commit git hook that automatically sorts Python imports using isort to maintain consistent code formatting.
- Automatic import sorting: Runs
isorton all staged Python files before each commit - Smart behavior: Only processes files that need changes and re-stages them
- User-friendly: Provides clear feedback and allows review of changes
- Django-optimized: Uses Django-specific import grouping and formatting rules
- When you run
git commit, the hook automatically activates - It checks all staged
.pyfiles for import order issues - If issues are found, it fixes them and re-stages the files
- The commit is paused to allow you to review the changes
- Run
git commitagain to complete the commit with properly sorted imports
The import sorting behavior is configured in pyproject.toml:
[tool.isort]
profile = "django"
multi_line_output = 3
include_trailing_comma = true
line_length = 88
known_first_party = "blowcomotion,search,website"
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "DJANGO", "FIRSTPARTY", "LOCALFOLDER"]You can also run isort manually:
# Check if files need sorting
isort --check-only blowcomotion/
# Fix import order
isort blowcomotion/isortmust be installed:pip install isort- The hook is automatically executable after cloning the repository
With the pre-commit hook enabled, your typical development workflow becomes:
# Make changes to Python files
git add blowcomotion/views.py
# Attempt to commit
git commit -m "Update views"
# If imports need fixing, the hook will:
# 1. Automatically fix import order
# 2. Re-stage the fixed files
# 3. Display a message asking you to review and commit again
# Review the changes (optional)
git diff --cached
# Commit again (will succeed if no further issues)
git commit -m "Update views"This ensures that all Python code follows consistent import formatting standards automatically.
- Start the development server
python manage.py runserver - Open your web browser and go to the homepage
- You can access the admin panel at http://localhost:8000/admin
- To stop the server, press
Ctrl+Cin the terminal
The project includes comprehensive unit tests for all major features.
python manage.py testpython -Wa manage.py test# Test attendance functionality
python manage.py test blowcomotion.tests.test_attendance_views
# Test birthday features
python manage.py test blowcomotion.tests.test_birthday_views
# Test member model
python manage.py test blowcomotion.tests.test_member_modeltest_attendance_views.py- Attendance tracking views and formstest_attendance_commands.py- Attendance management commandstest_birthday_views.py- Birthday display viewstest_birthday_command.py- Birthday email notification commandtest_member_model.py- Member model and instrument relationshipstest_chart_api.py- Chart library API endpointstest_sync_gigs_command.py- GigoGig API synchronizationtest_dump_data_view.py- Database export functionalitytest_export_charts_command.py- Chart export commandtest_export_library_instruments_command.py- Library instrument exporttest_fetch_embed_data.py- Video embed data fetchingtest_video_feed_block.py- Video feed block functionalitytest_recaptcha.py- reCAPTCHA validationtest_member_signup_go3.py- Member signup and GO3 integration
-
Navigate to the live website admin data dump page
-
Save the JSON file to your local machine
-
Navigate to the project directory
cd blowcomotion.org -
Import the data into the local database
python manage.py loaddata <path_to_json_file>
-
Log in to the admin panel at http://localhost:8000/admin to verify that the data has been imported successfully
-
In Page Explorer, delete the default "Welcome to your new Wagtail site!" page if it still exists
-
In Sites settings, set the localhost root page to the imported homepage
When deploying to production, always run:
python manage.py collectstatic- Collects all static files (CSS, JS, images) for productionpython manage.py migrate- Applies any new database migrations
Important: Run collectstatic after any changes to static files (CSS, JavaScript, images) to ensure they're available in production.
The attendance tracking system allows band leaders to record and manage attendance for rehearsals and performances with integrated gig management.
- Section-based tracking: Record attendance by band section (Woodwinds, High Brass, etc.)
- Section-aware roster: Members default to their primary section, while additional instruments make them available (flagged) in those sections too
- Member and guest support: Track both band members and guests/visitors
- Instrument capture: Record the specific instrument each member played for that session
- Event types: Differentiate between rehearsals and performances
- Gig integration: Automatically fetch and select from confirmed gigs when recording performance attendance
- Smart gig selection: Gigs are filtered by date, band (Blowcomotion), and confirmation status
- Dynamic form behavior: Event type selection shows/hides relevant fields (gig selection for performances, notes for rehearsals)
- Comprehensive reporting: View attendance statistics and trends
- Admin management: Full CRUD operations for attendance records through Wagtail admin
The attendance system now integrates with the GigoGig API to provide seamless gig selection:
- Automatic gig fetching: When "Performance" is selected, available gigs are loaded for the chosen date
- Real-time updates: Gig options update dynamically when the date changes
- Smart filtering: Only shows confirmed Blowcomotion gigs for the selected date
- Caching: Gig data is cached for 10 minutes to improve performance
- Fallback handling: Gracefully handles API errors and provides fallback options
- Recording Attendance: Access the attendance capture interface at
/attendance/ - Section Navigation: Select a band section to record attendance for that group
- Date Selection: Choose the date for the attendance session
- Event Type:
- Select "Rehearsal" for practice sessions (shows notes field)
- Select "Performance" for gigs (shows gig selection dropdown)
- Gig Selection (Performances only): Choose from available confirmed gigs for the selected date
- Member Selection: Check off members who attended
- Instrument Choice: The instrument is automatically determined for each attendee based on the section being viewed and the member's instrument assignments (no manual selection required)
- Guest Entry: Add names of guests/visitors (one per line)
- Submit: Record attendance with automatic event information
- API Integration: Connects to GigoGig API for real-time gig data
- JavaScript Enhancement: Dynamic form behavior with HTMX for seamless user experience
- Caching Strategy: Intelligent caching to reduce API calls and improve performance
- Error Handling: Robust error handling for network issues and API failures
- Navigate to Wagtail Admin > Band Stuff > Attendance Records
- View, edit, and delete attendance records
- Filter by date, member, or search notes
- Export data for external analysis
- View gig information in attendance notes
- Protected by HTTP Basic Authentication
- Password configurable through Wagtail Admin > Settings > Site Settings > Access Control
The birthdays feature displays upcoming band member birthdays to help celebrate and recognize members.
- Upcoming birthdays: Shows members with birthdays in the current month
- Privacy-aware: Only displays month/day, respects member privacy
- Mobile-friendly: Responsive design for all devices
- Admin integration: Birthday data managed through member profiles
- Access: Navigate to
/birthdays/to view the birthdays page - Display: Shows members with birthdays in the current month
- Information: Displays member name, birthday (month/day), and photo if available
- Member Profiles: Add birthday information in Wagtail Admin > Band Stuff > Members
- Fields:
birth_month,birth_day, and optionalbirth_year - Privacy: Birth year is optional and not displayed publicly
- Protected by HTTP Basic Authentication
- Password configurable through Wagtail Admin > Settings > Site Settings > Access Control
The following environment variables can be configured:
GIGO_API_URL- API endpoint for GIGO integration (default:http://localhost:8000/api)GIGO_API_KEY- API key for GIGO integration (required for gig features)
The attendance system integrates with the GigoGig API to fetch gig information:
- GET /gigs - Fetches all gigs, filtered client-side for date/band/status
- GET /gigs/{id} - Fetches specific gig details (used for attendance notes)
- Set the
GIGO_API_URLenvironment variable to your GigoGig API base URL - Set the
GIGO_API_KEYenvironment variable with your API key - The system will automatically fetch gigs when recording performance attendance
The application also provides a local API endpoint for gig data:
- GET /attendance/gigs-for-date/?date=YYYY-MM-DD - Returns filtered gigs for a specific date
This endpoint is used by the JavaScript frontend and includes caching for performance.
Site settings, including access control passwords, are configured through the Wagtail admin interface:
- Access Wagtail Admin > Settings > Site Settings
- Configure passwords in the Access Control section
- Set email recipients for forms in the Form Email Recipients section
- Update donation links in the Donation Links section
- Manage social media links and site branding
The Member model was refactored to improve instrument management and section assignment. See MEMBER_MODEL_REFACTOR.md for complete details.
Key changes:
- Split instruments into
primary_instrument(single) andadditional_instruments(multiple) - Members appear in their primary section by default, with additional instruments surfaced (and flagged as "Additional") in the relevant sections for quick access during attendance
- Migration 0076 automatically converted existing data
- Admin search uses Django queries instead of Wagtail FTS for better SQLite compatibility
Breaking changes:
- Attendance views now filter by
primary_instrumentinstead of many-to-manyinstruments - Templates display
member.primary_instrumentinstead of looping throughmember.instruments.all - Forms require setting primary instrument for proper section assignment