A simple, professional Flask web application for student registration with email notification. Students can scan a QR code, view program information, submit a registration form, and administrators receive email notifications with registration details.
This application follows the workflow:
- Landing Page - Student views flyer and academy information
- Registration Form - Student enters registration details
- Verification - Simple math question to prevent spam
- Email Notification - Administrator receives registration details
- Success Page - Confirmation message to student
✅ Clean, responsive landing page with flyer display
✅ Comprehensive registration form with server-side validation
✅ Simple math verification for human validation
✅ Professional email notifications to administrator
✅ Success confirmation page
✅ Bootstrap 5 responsive design
✅ Mobile-friendly interface
✅ Security-focused form handling
✅ Error page templates (404, 500)
cd-academy/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── README.md # This file
│
├── static/
│ ├── style.css # Custom CSS styling
│ └── images/
│ └── flyer.jpg # Flyer image (add your own)
│
└── templates/
├── base.html # Base template with navbar and footer
├── home.html # Landing page
├── register.html # Registration form
├── success.html # Success confirmation page
├── 404.html # Page not found error
└── 500.html # Server error page
- Backend: Python Flask
- Email: Flask-Mail
- Frontend: HTML5, CSS3, Bootstrap 5
- Environment: python-dotenv
- Validation: Server-side validation with helpful error messages
- Python 3.8 or higher
- pip (Python package manager)
- Git (optional)
# If using git
git clone <repository-url>
cd cd-academy
# Or download and extract the ZIP file, then navigate to the folderOn Windows (PowerShell or Command Prompt):
python3 -m venv venv
.\venv\Scripts\activateOn macOS/Linux:
python3 -m venv venv
source venv/bin/activatepip3 install -r requirements.txtCopy .env.example to .env:
# On Windows
copy .env.example .env
# On macOS/Linux
cp .env.example .envEdit .env and configure your settings:
# Flask Configuration
SECRET_KEY=your-secure-secret-key-here-change-for-production
# Email Configuration (Gmail example)
MAIL_SERVER=smtp.gmail.com
MAIL_PORT=587
MAIL_USE_TLS=True
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-specific-password
# Admin Email
ADMIN_EMAIL=admin@cdacademy.com
# Application Settings
APP_ENV=development
DEBUG=True-
Enable 2-Factor Authentication on your Google account
-
Generate an App-Specific Password:
- Go to https://myaccount.google.com/apppasswords
- Select "Mail" and "Windows Computer" (or your device)
- Google will generate a 16-character password
- Use this password as
MAIL_PASSWORDin.env
-
Set
MAIL_USERNAMEto your Gmail address -
Keep
MAIL_SERVER=smtp.gmail.comandMAIL_PORT=587
Adjust MAIL_SERVER and MAIL_PORT according to your provider:
- Outlook: smtp.office365.com:587
- Yahoo: smtp.mail.yahoo.com:587
- SendGrid: smtp.sendgrid.net:587
- AWS SES: email-smtp.[region].amazonaws.com:587
-
Create an
imagesfolder insidestatic:mkdir static/images
-
Place your flyer image at:
static/images/flyer.jpg- Recommended size: 600x400 pixels or larger
- Supported formats: JPG, PNG, GIF, WebP
- If no image is found, a placeholder will be displayed
python3 app.pyThe application will start on http://localhost:5000
- Home/Landing Page: http://localhost:5000/
- Registration Form: http://localhost:5000/register
- First Name: 2-50 characters, letters only
- Last Name: 2-50 characters, letters only
- Age: 5-25 years (numeric)
- School: 2-100 characters
- Name: 2-100 characters
- Email: Valid email format required
- Phone: Minimum 10 digits
- Area of Interest: Required selection (Web Dev, Mobile, Data Science, AI, Cloud, Cybersecurity, Game Dev, Other)
- Comments: Optional, maximum 500 characters
- Math Question: Simple addition/subtraction (auto-generated)
When a student registers, the administrator receives an email with:
Subject: New Registration: [Student Name]
New Student Registration
Student Information:
- Name: [First Last]
- Age: [Age]
- School: [School Name]
- Area of Interest: [Selected Area]
Parent/Guardian Information:
- Name: [Guardian Name]
- Email: [Guardian Email]
- Phone: [Guardian Phone]
Additional Comments:
[Comments or "None"]
DEBUG=True
APP_ENV=development
SECRET_KEY=dev-key-not-secure-
Change SECRET_KEY: Use a strong, random secret key
python3 -c "import secrets; print(secrets.token_hex(32))" -
Set DEBUG=False:
DEBUG=False APP_ENV=production SECRET_KEY=your-production-secret-key
-
Use a production WSGI server (not Flask's development server):
pip3 install gunicorn gunicorn -w 4 -b 0.0.0.0:5000 app:app
-
Security checklist:
- SECRET_KEY is strong and random
- DEBUG is False
- MAIL_PASSWORD is secure and not in version control
- ADMIN_EMAIL is correct
- Using HTTPS (configure reverse proxy like Nginx)
- Environment variables are set securely
To create a QR code pointing to the registration page:
-
QR Code Generator (free online tools):
-
Target URL:
https://yourdomain.com/register -
Test QR Code Locally:
- Use a QR code reader mobile app
- Scan to verify it points to:
http://localhost:5000/register
pip3 install gunicorn
heroku login
heroku create your-app-name
git push heroku main- Sign up at https://www.pythonanywhere.com
- Upload your files
- Create a Web app pointing to WSGI file
- Configure environment variables in Web tab
Use their Python/Flask deployment guides for Docker or direct deployment.
-
Check Gmail credentials:
- Verify app-specific password is correct
- Check 2FA is enabled
- Verify 16-character password (not your regular password)
-
Check email configuration:
# Add to app.py temporarily for debugging with app.app_context(): msg = Message('Test', recipients=['test@example.com'], body='Test') mail.send(msg)
-
Check firewall/proxy: Some networks block SMTP. Try different MAIL_PORT or MAIL_SERVER.
- Check browser console for client-side errors
- Server-side validation provides clear error messages
- Ensure field values match validation requirements
- Verify templates are in
templates/folder (case-sensitive) - Check file names match exactly (home.html, register.html, success.html, base.html)
- Place flyer.jpg in
static/images/folder - Verify correct file name and extension
- Check file permissions (readable)
- Use absolute path if needed in templates
This is Version 1 - suitable for basic registration needs. Potential future features:
- Database storage for registrations
- User authentication for admin dashboard
- Admin panel to view/export registrations
- Attendance tracking
- PDF export of registrations
- Multi-language support
- Participant QR codes/attendance scanning
- Payment integration
- Email templates customization
- ✅ Server-side validation on all form inputs
- ✅ XSS protection via Jinja2 templating
- ✅ CSRF protection via Flask sessions
- ✅ Email validation
- ✅ Phone number validation
- ✅ Human verification (math question)
- ✅ Secure session handling
⚠️ Use HTTPS in production⚠️ Never commit.envfile to version control (it's in.gitignore)
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Home/landing page |
| GET | /register |
Registration form (initial load) |
| POST | /register |
Submit registration form |
| GET | /success |
Success confirmation page |
- CSS: ~8 KB (minifiable)
- Static Assets: ~50 KB (flyer image varies)
- Load Time: < 2 seconds on typical connection
- Bootstrap: Served via CDN (faster loading)
- ✅ Chrome 90+
- ✅ Firefox 88+
- ✅ Safari 14+
- ✅ Edge 90+
- ✅ Mobile browsers (iOS Safari, Chrome Mobile)
This project is provided as-is for educational and commercial use.
For questions or issues:
- 📧 Email: info@cdacademy.com
- 📞 Phone: (555) 123-4567
- 📍 Location: 123 Education St., Tech City, TC 12345
- Landing page with flyer display
- Registration form with comprehensive validation
- Email notifications to administrator
- Success confirmation page
- Responsive Bootstrap 5 design
- Human verification (math questions)
- Environment variable configuration
- Error page templates
Built with ❤️ by C&D Academy Development Team