A Django-based web application for managing sports team schedules, divisions, clubs, and associations. This application helps sports organizations coordinate team scheduling, manage member relationships, and track division calendars.
98% vibe coded over 6 weeks with VSCode and CoPilot!
- Team Management: Create and manage teams with member administration
- Club System: Organize teams under clubs with location and member tracking
- Association Structure: Group clubs under associations for larger organizational management
- Division Scheduling: Automatic schedule generation based on age groups and tiers
- Calendar Views: Interactive calendars for teams and divisions
- User Roles: Support for team admins, club admins, and association admins
- Control Panel: Administrative interface for superusers to manage all entities
- Backend: Django 5.1, Python 3.8+
- Database: PostgreSQL
- Frontend: Bootstrap 5, JavaScript
- Authentication: Custom email-based authentication
- Environment Management: django-environ
- Deployment: Configured for Render (free tier available)
- Python 3.8 or higher
- PostgreSQL
- Git
-
Clone the repository
git clone <your-repo-url> cd TeamSchedule
-
Create a virtual environment
python -m venv venv # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
# Copy the example environment file cp .env.example .env # Edit .env with your actual values # See Environment Configuration section below
-
Set up PostgreSQL database
# Create database (adjust commands for your PostgreSQL setup) createdb teamschedule -
Run database migrations
python manage.py migrate
-
Create a superuser
python manage.py createsuperuser
-
Run the development server
python manage.py runserver
-
Access the application
- Open your browser to
http://localhost:8000 - Admin interface:
http://localhost:8000/admin
- Open your browser to
Create a .env file in the project root with the following variables:
# Django Security
SECRET_KEY=your-very-secret-key-here
DEBUG=True
# Database Configuration
DB_NAME=teamschedule
DB_USER=postgres
DB_PASSWORD=your-database-password
DB_HOST=localhost
DB_PORT=5432
# Email Configuration (for Gmail)
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-gmail-app-password
# Allowed Hosts (comma-separated)
ALLOWED_HOSTS=localhost,127.0.0.1
# CSRF Trusted Origins (for external domains, comma-separated)
CSRF_TRUSTED_ORIGINS=https://yourdomain.comTo generate a new Django secret key:
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())- Regular Users: Can be members of teams and clubs
- Team Admins: Can manage specific teams and their schedules
- Club Admins: Can manage clubs and all teams within those clubs
- Association Admins: Can manage associations and all clubs/teams within
- Superusers: Full access to all functionality including the control panel
- Creating Teams: Navigate to Control Panel → Teams → Create Team
- Managing Schedules: Teams can set availability dates for automatic scheduling
- Division Calendars: View generated schedules for entire divisions
- Member Management: Add users to teams, clubs, and associations
TeamSchedule/
├── teamschedule/ # Django project settings
├── users/ # Main application
│ ├── models.py # Data models (User, Team, Club, Association, etc.)
│ ├── views.py # View controllers
│ ├── forms.py # Django forms
│ ├── templates/ # HTML templates
│ ├── services/ # Business logic services
│ └── migrations/ # Database migrations
├── static/ # Static files (CSS, JS, images)
├── requirements.txt # Python dependencies
└── manage.py # Django management script
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Django best practices
- Write descriptive commit messages
- Add tests for new features
- Update documentation for any new functionality
This application is configured for easy deployment on Render, a modern cloud platform with free tier options.
-
Fork this repository to your GitHub account
-
Create a Render account at render.com and connect your GitHub
-
Create a PostgreSQL database:
- Go to your Render dashboard
- Click "New +" → "PostgreSQL"
- Name:
teamschedule-db - Choose the free plan
- Click "Create Database"
-
Deploy the web service:
- Click "New +" → "Web Service"
- Connect your forked repository
- Configure:
- Build Command:
./build.sh - Start Command:
gunicorn teamschedule.wsgi:application - Environment: Python 3
- Build Command:
- Add environment variables:
SECRET_KEY: Generate a secure random stringDEBUG:FalseDATABASE_URL: (Will be auto-filled when you connect the database)ALLOWED_HOSTS:your-app-name.onrender.com
- Choose the free plan
- Click "Create Web Service"
-
Connect the database:
- In your web service settings, go to "Environment"
- Click "Add from Database" and select your PostgreSQL database
- This will automatically add the
DATABASE_URLenvironment variable
If you prefer to deploy manually or on another platform:
Before deploying to production:
- Set
DEBUG=Falsein environment variables - Use a strong, unique
SECRET_KEY - Configure proper
ALLOWED_HOSTS - Set up HTTPS and update
CSRF_TRUSTED_ORIGINS - Use environment variables for all sensitive data
- Set up proper logging and monitoring
- Configure database backups
- Set up your production server with Python and PostgreSQL
- Clone the repository and set up the virtual environment
- Configure production environment variables (see
.env.example) - Make the build script executable:
chmod +x build.sh - Run the build script:
./build.sh - Start the application:
gunicorn teamschedule.wsgi:application - Set up a reverse proxy (Nginx, Apache) if needed
- Set up SSL certificates
For production deployment, you'll need to set these environment variables:
| Variable | Description | Required |
|---|---|---|
SECRET_KEY |
Django secret key (generate a new one) | Yes |
DEBUG |
Set to False for production |
Yes |
DATABASE_URL |
PostgreSQL connection string | Yes |
ALLOWED_HOSTS |
Comma-separated list of allowed hosts | Yes |
EMAIL_HOST_USER |
Email for notifications (optional) | No |
EMAIL_HOST_PASSWORD |
Email password/app password | No |
-
Database Connection Errors
- Verify PostgreSQL is running
- Check database credentials in
.env - Ensure database exists
-
Email Configuration Issues
- For Gmail, use an App Password, not your regular password
- Enable 2-factor authentication and generate an app-specific password
-
Static Files Not Loading
- Run
python manage.py collectstatic - Check static file configuration in settings
- Run
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue on the GitHub repository or contact the development team.
- Initial release
- Team, Club, and Association management
- Division scheduling system
- User authentication and authorization
- Control panel for administrators