A comprehensive Django-based ticket booking system for movies, sports events, and transport services with MongoDB integration.
- Movie Events: Book movie tickets with seat management
- Sports Events: Cricket and football match bookings
- Transport Services: Bus and train ticket reservations
- Real-time Seat Availability: Live seat tracking
- Featured Events: Highlighted events on homepage
- User Registration & Authentication: Secure login/logout
- User Profiles: Extended profile with contact information
- Profile Updates: Edit personal information
- Booking History: View past bookings
- Wishlist: Save favorite events
- Multi-Event Support: Book any type of event
- Seat Selection: Real-time seat availability
- Booking Management: View, update, and cancel bookings
- Payment Integration: Secure payment processing
- Booking Status: Track booking status (booked/cancelled)
- Event Search: Search by name, location, or type
- Event Filtering: Filter by event type (movies, sports, transport)
- Event Details: Comprehensive event information
- Responsive Design: Works on all devices
- CSRF Protection: Cross-site request forgery protection
- Authentication: Secure user authentication
- Authorization: Role-based access control
- Input Validation: Form validation and sanitization
- Session Management: Secure session handling
- Client Layer: Web browsers, mobile devices
- Presentation Layer: Django templates, Bootstrap CSS, JavaScript
- Application Layer: Django views, URL routing, forms
- Business Logic Layer: Event management, booking engine, user management
- Data Access Layer: Django ORM, MongoDB driver
- Data Storage Layer: MongoDB collections, file storage
- External Services: Payment gateway, email, SMS services
- User: Authentication and user data
- UserProfile: Extended user information
- MovieEvent: Movie screenings and details
- SportsEvent: Sports events (cricket, football)
- Transport: Bus and train services
- Booking: Ticket reservations
- Wishlist: Saved events
- Django 2.2: Web framework
- Python 3.12: Programming language
- MongoDB: NoSQL database
- Djongo: MongoDB connector for Django
- HTML5: Markup language
- CSS3: Styling
- Bootstrap: Responsive UI framework
- JavaScript: Client-side functionality
- AJAX: Asynchronous requests
- MongoDB: Primary database
- Collections: Organized data storage
- File Storage: Images and static assets
- Python 3.12 or higher
- MongoDB 4.0 or higher
- Git
git clone https://github.com/yourusername/ticket-booking-system.git
cd ticket-booking-systempython -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activatepip install -r requirements.txt- Install MongoDB on your system
- Start MongoDB service
- Create a database for the project
- Copy
ticketbooking/settings.pytoticketbooking/local_settings.py - Update database settings in
local_settings.py - Set
SECRET_KEYandDEBUGsettings
python manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py setup_mongodbpython manage.py runserverticket-booking-system/
βββ booking/ # Main Django app
β βββ management/ # Custom management commands
β βββ migrations/ # Database migrations
β βββ static/ # Static files (CSS, JS, images)
β βββ templates/ # HTML templates
β βββ admin.py # Django admin configuration
β βββ forms.py # Django forms
β βββ models.py # Django models
β βββ mongo_models.py # MongoDB models
β βββ urls.py # URL routing
β βββ views.py # View functions
βββ ticketbooking/ # Django project settings
β βββ settings.py # Django settings
β βββ urls.py # Main URL configuration
β βββ wsgi.py # WSGI configuration
βββ media/ # User uploaded files
βββ staticfiles/ # Collected static files
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ er_diagram.puml # Entity Relationship Diagram
βββ block_diagram.puml # System Architecture Diagram
βββ manage.py # Django management script
- AJAX-based seat updates
- Real-time seat tracking
- Automatic seat reservation
- Extended user profiles
- Contact information storage
- Profile update functionality
- Multi-event booking support
- Seat management
- Booking status tracking
- Save favorite events
- Wishlist management
- Quick booking from wishlist
Create a .env file in the project root:
DEBUG=True
SECRET_KEY=your-secret-key-here
DATABASE_URL=mongodb://localhost:27017/ticketbookingUpdate database settings in ticketbooking/settings.py:
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'ticketbooking',
'HOST': 'localhost',
'PORT': 27017,
}
}python manage.py testpython manage.py test booking.testspython manage.py setup_mongodbpython manage.py clean_duplicate_profilespython manage.py debug_profiles- Set
DEBUG=Falsein settings - Configure production database
- Set up static file serving
- Configure HTTPS
- Set up environment variables
- Create
Procfile - Configure
runtime.txt - Set up MongoDB Atlas
- Deploy to Heroku
- Index frequently queried fields
- Use MongoDB aggregation pipelines
- Implement caching strategies
- Minify CSS and JavaScript
- Optimize images
- Use CDN for static files
- Secure password hashing
- Session management
- CSRF protection
- Input validation
- SQL injection prevention
- XSS protection
- Rate limiting
- API authentication
- Request validation
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work - YourGitHub
- Django community for the excellent framework
- MongoDB team for the database
- Bootstrap team for the UI framework
- All contributors and testers
For support and questions:
- Create an issue on GitHub
- Email: your.email@example.com
- Documentation: Wiki
- v1.0.0 - Initial release with basic booking functionality
- v1.1.0 - Added wishlist and profile management
- v1.2.0 - Real-time seat availability
- v1.3.0 - Payment integration and security improvements
Made with β€οΈ using Django and MongoDB