Skip to main content

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.

Metadata

Release files for django-sightline 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-sightline 0.1.0
File Size Uploaded Provenance Actions
django_sightline-0.1.0.tar.gz 119.7 kB Without provenance Details for django_sightline-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-sightline 0.1.0
File Interpreter ABI Platform Actions
django_sightline-0.1.0-py3-none-any.whl Python 3 none any Details for django_sightline-0.1.0-py3-none-any.whl

Total release size: 243.2 kB

Release files / django_sightline-0.1.0.tar.gz

Download URL django_sightline-0.1.0.tar.gz
Size 119.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6353da51ce84fb65af14e12b99a5ae386b77bb0dd8733de9b3599d4f8dc6b6fc
BLAKE2b-256 checksum
How to use checksums
3b736379c37fdf124d7ced2e9e1dd10bdff1efda2805534d807321e9b9255cbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release files / django_sightline-0.1.0-py3-none-any.whl

Download URL django_sightline-0.1.0-py3-none-any.whl
Size 123.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6c49c2c9588a02ec752c24c1c28365c8f0fd3476fbdaf18f03282add0c6be0f
BLAKE2b-256 checksum
How to use checksums
879b4dafb9edf51b5f9cb62965812c671d203bb7c8e69c862d46f05d78a57951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Security for django-sightline 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page