integration-django

Integrate Amplitude analytics into Django applications with environment-based API key configuration.

28|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/amplitude/wizard --skill integration-django-amplitude
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-django
Source: https://github.com/amplitude/wizard/tree/main/skills/integration/integration-django
Command: npx skills add https://github.com/amplitude/wizard --skill integration-django-amplitude

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Django projects need a consistent, server-side approach to instrument Amplitude: identifying users, tracking events, and maintaining a clean key management strategy.

Core Features & Use Cases

  • Server-side client singleton for Amplitude in Django, with safe API key handling via environment variables.
  • Standard event patterns (User Logged In, User Logged Out, Dashboard Viewed, Burrito Considered, Profile Viewed, Error Triggered) to enable cross-project analytics.
  • Guidance for user identification via Identify objects and consistent user_id usage to link events across sessions.
  • Reference examples and best practices for environment configuration and minimal changes to existing code.

Quick Start

Run the Django app with AMPLITUDE_API_KEY set in the environment and login to trigger example Amplitude events.

Frequently Asked Questions about integration-django

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Amplitude analytics to a Django app?

Add Amplitude analytics to Django by wiring a singleton client into server routes to track events and identify users. It enforces environment variable usage for API keys to ensure safe data handling across your project.

What is the best way to track server-side events in Django with Amplitude?

Track server-side events using standard patterns like User Logged In, Dashboard Viewed, and Error Triggered from Django views. These consistent naming conventions enable cross-project analytics and minimal changes to existing code.

How does user identification work with Amplitude in Django?

User identification works by using Identify objects and a consistent user_id strategy to link events across sessions. This server-side approach ensures accurate user tracking within Django authentication workflows like login and logout.

Do I need environment variables to configure the Amplitude API key in Django?

Yes, you need to set the AMPLITUDE_API_KEY environment variable to configure the client safely. This environment-based configuration strategy prevents hardcoding sensitive API keys directly into your Django project source code.

Can I use Django middleware to track Amplitude page views?

Yes, you can use Django middleware to track Amplitude page views alongside other server-side workflows. The integration provides reference examples and best practices for implementing tracking patterns with minimal changes to existing code.