django_webapps_fullstack.landing.views¶
This module implements the public-facing entry point for the dingx logistics platform. It provides the landing page for new visitors and handles multi-language support through language selection functionality. The landing page serves as the gateway to user registration and login.
Business Context:
The landing app is the first point of contact for potential users of the dingx platform. It presents the value proposition of the logistics management system and guides visitors to either register a new account or log in to an existing one. The module supports internationalization, allowing users to select their preferred language before registration.
Key Business Workflows:
Landing Page:
home(): First page visitors see when accessing the platformPresents dingx logistics service information
Provides call-to-action for registration
Automatically redirects logged-in users to their dashboard
Available in multiple languages
Language Selection:
set_language(): Users can select their preferred languageLanguage choice persists via cookie
Affects entire platform interface
Supports all languages defined in Django settings
Immediate language activation for current request
User Journey:
New Visitor: - Arrives at home page - Selects preferred language (optional) - Clicks to register → Redirected to account/register - Creates account and starts using platform
Returning User: - Arrives at home page - Already logged in → Automatically redirected to dashboard overview - Not logged in → Can select language and navigate to login
Technical Features:
Language cookie management with Django settings
Session detection for logged-in users
Automatic redirection based on authentication state
Support for multiple languages via Django i18n
Clean separation of public and authenticated areas
Integration:
The landing app integrates with: - Account app for registration and login - Dashboard app for logged-in user redirection - Django’s internationalization framework for multi-language support
Security:
No authentication required (public access)
Safe handling of invalid language codes
No sensitive data exposure
Functions
|
Prepare the home page. |
|
Handle language selection by the user and set the appropriate language cookie. |