✅ Purpose
Central entity representing a landing page and its deployment settings.
🧩 Fields
name— unique namecampaign— FK to Campaigndomains— Many‑to‑Many to Domainroute— URL path (validated byvalidate_route)title— optionalbackground— image/video file (.jpg/.jpeg/.png/.gif/.webp/.mp4, max 10 MB)favicon— image (.ico/.png/.jpg/.jpeg/.svg, max 150 KB, 100×100)service_worker— FK to ServiceWorkercode_snippet— FK to CodeSnippettemplate— FK to Templatebuttons_container— FK to ButtonsContainerclick_link,double_link,postback_link,back_link,background_click_link- optional URLs validated by
validate_url_prefix(http://orhttps://)
- optional URLs validated by
landing_links— JSON list of deployed URLsis_active— deployment flagnotes— optionalowner— FK to Usercreated_at,updated_at
🧠 Properties & methods
-
rendered_favicon→media/<file>or empty string -
rendered_background→media/<file>or empty string -
add_landing_link(url)- ensures list exists, appends URL, saves
-
remove_landing_links()- clears links and deactivates landing
-
get_landing_links()- returns list or empty list
-
render_html()- builds template context (title, favicon, links, JS tags, etc.)
- renders ButtonsContainer HTML and injects per‑button overrides
- renders final template HTML and returns it
-
copy(new_domain, new_route, user=None)- creates a new Landing copy
- checks for existing landing on the new domain/route
- copies ButtonClick entries
-
__str__()→ returnsname
🔗 Relations
Deployment.landingButtonClick.landingLandingTransferLog.landing
⚠️ Notes
Route uniqueness is enforced per domain in Admin and in copy().