Installation Guidelines
Django
How to add Faurya to your Django project.
Add Faurya to your Django project
Follow these steps to integrate Faurya analytics into your Django application.
Add tracking script to base template
The recommended way to add scripts to all pages in a Django application is by using the base template.
- Open your project's base template, typically located at
templates/base.html. - Add the Faurya tracking script to the
<head>section of your template:
<!-- templates/base.html -->
<!DOCTYPE html>
<html>
<head>
<script
defer
data-website-id="YOUR_WEBSITE_ID"
data-domain="yourdomain.com"
src="https://faurya.com/js/script.js"
></script>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>Replace yourdomain.com with your website's root domain.
Alternative: Using Django settings
For more dynamic configuration, you can add the script through Django settings:
- Add your Faurya configuration to
settings.py:
# settings.py
FAURYA_WEBSITE_ID = 'YOUR_WEBSITE_ID'
FAURYA_DOMAIN = 'yourdomain.com'- In your base template, use the settings:
{% load settings_tags %}
<script
defer
data-website-id="{{ FAURYA_WEBSITE_ID }}"
data-domain="{{ FAURYA_DOMAIN }}"
src="https://faurya.com/js/script.js"
></script>Verify installation
After implementing either method:
- Visit your live website
- Check your Faurya dashboard for incoming data
- It might take a few minutes for the first pageviews to appear
For advanced configuration options like localhost tracking, custom API endpoints, or cross-domain setup, see the script configuration reference.