Skip to main content

Smart, privacy-friendly site analytics for Django. Track visits, popular pages, referrers, and more — directly from the admin dashboard.

Project description

django-sightline 🕵️‍♂️

Smart, privacy-friendly site analytics for Django. Track visits, popular pages, referrers, and more — directly from the admin dashboard.

Features ✨

  • 🔒 Privacy-Focused: Designed with user privacy in mind.
  • 🛠️ Admin Dashboard Integration : View analytics directly within Django's admin interface.
  • 📈 Page Tracking: Monitor page visits and identify popular content.
  • 🔗 Referrer Tracking: Understand where your traffic is coming from.
  • 🎨 Customizable: Easily extend and modify to fit your project's needs.

🚀 Next Steps

  • 🔗 Add a referral system
  • ⚡ Reduce logging load in VisitLog
  • 🔍 Add filters in the admin panel
  • 📚 Implement documentation

Installation ⚙️

  1. Install the package via pip:

    pip install django-sightline
    
  2. Add 'sightline' to your INSTALLED_APPS in settings.py:

    INSTALLED_APPS = [
        ...
        'sightline',
        ...
    ]
    
  3. Run migrations to set up the necessary database tables:

    python manage.py migrate sightline
    
  4. Include the middlewares you need in your MIDDLEWARE settings:

    MIDDLEWARE = [
        ...
        'sightline.middleware.VisitLogMiddleware',
        ...
    ]
    
  5. Optionally, configure the SIGHTLINE_SETTINGS dicts to customize your tracking experience:

    SIGHTLINE_SETTINGS = {
         "visit": {
             "enabled": True,
             "exclude_path": r"^/admin/",
             "interval_capturing": 5 # Seconds
         },
         "geoip": {
             "enabled": False,
             "marker_interval": 10 # days
         }
    }
    

dashboard

Usage 📝

Once installed, django-sightline automatically tracks page visits and referrers. You can view the analytics data in the Django admin interface under the "Sightline" section.

To customize the behavior, you can extend the provided models and middleware. For example, to track additional data or modify the tracking logic, customize your Admin Model with BaseLogAdmin and override the methods and criteria for metrics generation.

Contributing 🤝

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add new feature').
  5. Push to the branch (git push origin feature-branch).
  6. Create a new Pull Request.

License 🔑

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_sightline-0.1.0.tar.gz (119.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_sightline-0.1.0-py3-none-any.whl (123.5 kB view details)

Uploaded Python 3

File details

Details for the file django_sightline-0.1.0.tar.gz.

File metadata

  • Download URL: django_sightline-0.1.0.tar.gz
  • Upload date:
  • Size: 119.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for django_sightline-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6353da51ce84fb65af14e12b99a5ae386b77bb0dd8733de9b3599d4f8dc6b6fc
MD5 2cd81cd735276369db0913a113bb34a6
BLAKE2b-256 3b736379c37fdf124d7ced2e9e1dd10bdff1efda2805534d807321e9b9255cbb

See more details on using hashes here.

File details

Details for the file django_sightline-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sightline-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6c49c2c9588a02ec752c24c1c28365c8f0fd3476fbdaf18f03282add0c6be0f
MD5 7dc702d07750cbf581c20dd3f0deca84
BLAKE2b-256 879b4dafb9edf51b5f9cb62965812c671d203bb7c8e69c862d46f05d78a57951

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page