{"id":17942508,"url":"https://github.com/zhebrak/django-statsy","last_synced_at":"2026-03-04T00:32:32.710Z","repository":{"id":23678520,"uuid":"27049965","full_name":"zhebrak/django-statsy","owner":"zhebrak","description":"Statistics for your Django project","archived":false,"fork":false,"pushed_at":"2019-03-29T21:59:42.000Z","size":1345,"stargazers_count":61,"open_issues_count":13,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-14T10:40:22.560Z","etag":null,"topics":["django","python","statistics"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhebrak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-23T22:12:29.000Z","updated_at":"2025-09-01T08:07:22.000Z","dependencies_parsed_at":"2022-07-12T06:30:24.269Z","dependency_job_id":null,"html_url":"https://github.com/zhebrak/django-statsy","commit_stats":null,"previous_names":["fata1ex/django-statsy"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zhebrak/django-statsy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhebrak%2Fdjango-statsy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhebrak%2Fdjango-statsy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhebrak%2Fdjango-statsy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhebrak%2Fdjango-statsy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhebrak","download_url":"https://codeload.github.com/zhebrak/django-statsy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhebrak%2Fdjango-statsy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30067726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","python","statistics"],"created_at":"2024-10-29T03:05:59.827Z","updated_at":"2026-03-04T00:32:32.573Z","avatar_url":"https://github.com/zhebrak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Django Statsy\r\n========\r\n\r\n[![Build Status](https://travis-ci.org/zhebrak/django-statsy.svg)](https://travis-ci.org/zhebrak/django-statsy) [![PyPI version](https://badge.fury.io/py/django-statsy.svg)](http://badge.fury.io/py/django-statsy)\r\n\r\nStatsy is an application for collecting and displaying statistics in your Django project.\r\n\r\n\r\n### Basic Usage\r\n\r\nView decorator:\r\n\r\n```python\r\n@statsy.watch\r\ndef index(request):\r\n    ...\r\n```\r\n\r\n```python\r\n@statsy.watch(group='index', event='page_view')\r\ndef index(request):\r\n    ...\r\n```\r\n\r\nInside the view:\r\n\r\n```python\r\ndef like(request):\r\n  statsy.send(\r\n    group='post', event='like', user=request.user,\r\n    value=17, content_object=post\r\n  )\r\n  ...\r\n```\r\n\r\nCBV Mixin:\r\n\r\n```python\r\nclass AboutView(WatchMixin, TemplateView):\r\n    template_name = 'example/about.html'\r\n\r\n    watch_group = 'info'\r\n    watch_event = 'page_view'\r\n    ...\r\n```\r\n\r\nFrom the template:\r\n\r\n```javascript\r\n{% load statsy %}\r\n\r\n{% statsy %}\r\n\r\n...\r\n\r\nvar statsy = new Statsy()\r\n\r\nstatsy.send({\r\n  'group': 'post',\r\n  'event': 'subscription'\r\n});\r\n```\r\n\r\n### Installation\r\n\r\n```\r\npip install django-statsy\r\n```\r\n\r\n```python\r\n# settings.py\r\n\r\nINSTALLED_APPS = (\r\n  ...\r\n\r\n  'statsy',\r\n)\r\n```\r\n\r\nIf you want to display collected statistics you will also have to add Statsy's URLs to your project's URLs.\r\n\r\n```python\r\n# urls.py\r\n  ...\r\n\r\n  url(r'^stats/', include('statsy.urls')),\r\n  ...\r\n```\r\n\r\n### Dashboard\r\n\r\nDefault out of the box graphs.\r\n\r\n![group_overview](https://raw.github.com/zhebrak/django-statsy/master/docs/img/dashboard.png)\r\n\r\n\r\n### Configuration\r\nThere are some settings you may want to change (default values are specified).\r\n```python\r\n# settings.py\r\n\r\n# By default Statsy caches lookups for a group and event\r\nSTATSY_CACHE_TIMEOUT = 60 * 15  # in seconds\r\n\r\n# Statsy can work in async mode with Celery up and running\r\nSTATSY_ASYNC = False\r\n\r\n# Full path to Celery application instance (e.g. 'example.celery_app.app')\r\nCELERY_APP = None\r\n\r\n# Permission to view stats pages\r\nSTATSY_VIEW_PERMISSION = 'statsy.stats_view'\r\n```\r\n\r\n\r\n### Collect Options\r\n\r\nAll are optional.\r\n```python\r\n# categorizing options\r\n'group'\r\n'event'\r\n\r\n# some additional info about the stats object\r\n'label'\r\n\r\n# user associated with the action\r\n# collected by default in @watch\r\n'user'\r\n\r\n# object of the action\r\n'content_object'\r\n\r\n# value can be \u003cint\u003e, \u003cfloat\u003e or \u003cstr\u003e/\u003cunicode\u003e/etc.\r\n'value'\r\n\r\n# where did it happen\r\n# collected by default in @watch\r\n'url'\r\n\r\n# how long did it take \u003cint\u003e\r\n# collected by default in @watch\r\n'duration'\r\n\r\n# JSON for an extra data\r\n'extra'\r\n```\r\n\r\n### Extending\r\n\r\nIf you want to add your custom stats page to Statsy you'll have to register it manually in \"stats.py\".\r\n\r\n```python\r\n# stats.py\r\nimport statsy\r\n\r\ndef some_awesome_stats(request):\r\n    return render_to_response('app/awesome_stats.html')\r\n\r\nstatsy.site.register(some_awesome_stats)\r\n```\r\n\r\nYou can also specify a category, a name or a permission\r\n\r\n```python\r\nstatsy.site.register(\r\n    some_awesome_stats,\r\n    category='Awesome stats',\r\n    name='Most awesome',\r\n    permission='user.view_awesome_stats'\r\n)\r\n```\r\n\r\n### License\r\n[MIT](https://github.com/zhebrak/django-statsy/raw/master/LICENSE)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhebrak%2Fdjango-statsy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhebrak%2Fdjango-statsy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhebrak%2Fdjango-statsy/lists"}