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:

  1. Landing Page:

  • home(): First page visitors see when accessing the platform
    • Presents dingx logistics service information

    • Provides call-to-action for registration

    • Automatically redirects logged-in users to their dashboard

    • Available in multiple languages

  1. Language Selection:

  • set_language(): Users can select their preferred language
    • Language choice persists via cookie

    • Affects entire platform interface

    • Supports all languages defined in Django settings

    • Immediate language activation for current request

User Journey:

  1. New Visitor: - Arrives at home page - Selects preferred language (optional) - Clicks to register → Redirected to account/register - Creates account and starts using platform

  2. 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

home(request)

Prepare the home page.

set_language(request)

Handle language selection by the user and set the appropriate language cookie.

django_webapps_fullstack.landing.views.home(request)[source]

Prepare the home page. After “submit” the page, the user will will redirected to the “overview” page of the dashboard, if the user is already logged in. Otherwise a new account could be registered.

django_webapps_fullstack.landing.views.set_language(request)[source]

Handle language selection by the user and set the appropriate language cookie.