django_landing_simple.landing_simple.views

This module implements a simple, public-facing landing page for web applications. It provides a minimal entry point for visitors with multi-language support through language selection functionality and Google Analytics integration for visitor tracking.

Business Context:

The landing_simple app serves as a lightweight, standalone landing page solution for web applications that don’t require user authentication or complex workflows. It’s designed for informational websites, marketing pages, or simple web applications where the primary goal is to present information to visitors and allow them to select their preferred language.

Key Business Features:

  1. Landing Page:

  • home(): Simple, static home page for all visitors
    • No authentication or user management required

    • Responsive design for all devices

    • Multi-language support for international audiences

    • Google Analytics integration for visitor tracking

  1. Language Selection:

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

    • Affects entire application interface

    • Supports all languages defined in Django settings

    • Immediate language activation for current request

User Journey:

  1. First-Time Visitor:

  • Arrives at home page
    • Views content in default language

    • Can select preferred language from language selector

    • Language preference saved for future visits

    • Navigates through application in selected language

  1. Returning Visitor:

  • Arrives at home page
    • Content displayed in previously selected language (via cookie)

    • Can change language at any time

Technical Features:

  • Google Analytics (GA4) integration via Measurement ID

  • Language cookie management with Django settings

  • Multi-language support via Django i18n framework

  • Simple, lightweight implementation

  • No database dependencies

  • No session management required

Integration:

The landing_simple app integrates with: - Django’s internationalization framework for multi-language support - Google Analytics for visitor tracking and metrics - Django settings for configuration (GOOGLE_MEASUREMENT_ID, LANGUAGES)

Security:

  • No authentication required (public access)

  • Safe handling of invalid language codes

  • No sensitive data exposure

  • No user data collection (beyond Google Analytics)

Use Cases:

  • Simple marketing landing pages

  • Product information websites

  • Service description pages

  • Static content delivery

  • Multi-language informational sites

  • Websites without user authentication requirements

Functions

home(request)

Prepare the home page.

set_language(request)

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

django_landing_simple.landing_simple.views.home(request)[source]

Prepare the home page.

django_landing_simple.landing_simple.views.set_language(request)[source]

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