How ateeb09/travel2india works
Purpose and Entry Points
Travel2India is a server-rendered Django travel discovery and lead-generation application. It presents curated destination content, accepts trip/flight requests, initiates and verifies Razorpay payments, and sends admin notifications. Development starts through travel2india/manage.py; production runs the WSGI app at travel2india/travel2india/wsgi.py, with deployment commands in travel2india/Procfile and travel2india/build.sh.
Django Composition and Routing
The project configuration, middleware, database selection, static handling, environment-driven secrets, and root routing belong to travel2india/travel2india/settings.py and travel2india/travel2india/urls.py. The core Django app owns application routing and request handlers through travel2india/core/urls.py and travel2india/core/views.py. ASGI support also exists at travel2india/travel2india/asgi.py, though the documented production gateway is Gunicorn/WSGI.
Content Discovery and Search
Destination browsing is primarily template-driven: landing, destination listing, and per-destination detail pages reside in travel2india/templates/home.html, travel2india/templates/destinations.html, and the travel2india/templates/detail_*.html set. Search requests are handled in travel2india/core/views.py and rendered through travel2india/templates/search_results.html; the search boundary translates user keywords into matching curated destination content rather than querying an external travel inventory service.
Lead Capture and Persistence
The core domain models define durable user-submitted records, including contact messages, trip inquiries, flight bookings, and payments, in travel2india/core/models.py. Form validation and request-to-model binding are centralized in travel2india/core/forms.py; schema evolution is recorded in travel2india/core/migrations/0001_initial.py through 0003_contactmessage_flightbooking_inquiry_and_more.py. Relevant form workflows render travel2india/templates/contact.html, travel2india/templates/inquiry.html, and travel2india/templates/flight_booking.html, then redirect to success pages.
Notifications and Shared Presentation
After lead submission, application logic invokes the email boundary in travel2india/core/email_service.py, using configured SMTP/Gmail credentials to notify administrators. Shared template context is supplied by travel2india/core/context_processors.py, while travel2india/templates/base.html provides the common page shell, navigation, theme behavior, and client-side widget integration.
Payments
Payment processing crosses from Django to Razorpay Checkout: payment views in travel2india/core/views.py create or coordinate payment requests, travel2india/templates/payment.html hosts the checkout-facing UI, and the Payment persistence model is defined in travel2india/core/models.py. Razorpay key ID and secret are environment-provided credentials; backend verification is the trust boundary before a payment record is treated as valid.
Runtime, Assets, and Deployment
The runtime is Python 3.12/Django 5.1.6 with SQLite locally and Render-provisioned PostgreSQL in production. travel2india/requirements.txt supplies Django, Gunicorn, WhiteNoise, database, and payment dependencies. WhiteNoise serves production static assets from travel2india/static/, including global styling at travel2india/static/css/style.css. Render runs the build script, migrations/static collection as configured, and Gunicorn; PostgreSQL connectivity arrives through DATABASE_URL.
Main entry points: views.py Request handlers · settings.py Project settings · models.py Lead & payment models · Procfile Render deployment
Components 19
Runtime & Deployment
- Django CLI · Development commands and management tasks.
travel2india/manage.py - Render deployment · Builds, migrates, collects static files, and starts Gunicorn.
travel2india/Procfile - Build script
travel2india/build.sh - Gunicorn WSGI
travel2india/travel2india/wsgi.py - WhiteNoise · Serves collected production assets.
Django Application
- Project settings · Configures middleware, secrets, database, static handling, and installed apps.
travel2india/travel2india/settings.py - Root routing
travel2india/travel2india/urls.py - Core routing
travel2india/core/urls.py - Request handlers · Serves content, search, lead workflows, and payment coordination.
travel2india/core/views.py - Lead forms · Binds and validates contact, inquiry, and flight submissions.
travel2india/core/forms.py - Lead & payment models · Stores contact messages, inquiries, flight bookings, and payments.
travel2india/core/models.py - Schema migrations
travel2india/core/migrations/0001_initial.py - Admin notifications
travel2india/core/email_service.py
Templates & Assets
- Page templates · Includes destination, search, lead, success, and payment pages.
travel2india/templates/base.html - Template context
travel2india/core/context_processors.py - Static assets
travel2india/static
External Services
- SQLite / PostgreSQL · Uses SQLite locally and Render PostgreSQL through DATABASE_URL in production.
- Razorpay Checkout · Payment creation and backend verification boundary.
- SMTP / Gmail · Delivers administrator lead notifications.
Connections 20
- Render deployment → Build script: runs
- Render deployment → Gunicorn WSGI: starts
- Django CLI → Project settings: loads
- Gunicorn WSGI → Project settings: loads
- Project settings → Root routing: configures
- Project settings → SQLite / PostgreSQL: connects
- Project settings → WhiteNoise: enables
- Root routing → Core routing: includes
- Core routing → Request handlers: dispatches to
- Request handlers → Page templates: renders
- Template context → Page templates: supplies shared context
- WhiteNoise → Static assets: serves
- Request handlers → Lead forms: validates submissions
- Lead forms → Lead & payment models: binds to
- Request handlers → Lead & payment models: reads and persists
- Schema migrations → Lead & payment models: evolves schema for
- Lead & payment models → SQLite / PostgreSQL: stores records
- Request handlers → Admin notifications: notifies after leads
- Admin notifications → SMTP / Gmail: sends via
- Request handlers → Razorpay Checkout: creates and verifies payments