{"id":15559854,"url":"https://github.com/richardarpanet/django-simple-activity","last_synced_at":"2026-04-26T01:31:28.522Z","repository":{"id":138866915,"uuid":"127967499","full_name":"richardARPANET/django-simple-activity","owner":"richardARPANET","description":"Simple, generic, activity streams from the actions on your site.","archived":false,"fork":false,"pushed_at":"2020-10-12T19:17:14.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-30T08:27:54.484Z","etag":null,"topics":["activity-stream","activity-streams","django","events","python","python-library","python2","python3"],"latest_commit_sha":null,"homepage":"https://code.richard.do/richardARPANET/django-simple-activity","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richardARPANET.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-03T20:52:12.000Z","updated_at":"2018-04-28T22:00:12.000Z","dependencies_parsed_at":"2024-05-30T17:29:03.305Z","dependency_job_id":null,"html_url":"https://github.com/richardARPANET/django-simple-activity","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/richardARPANET/django-simple-activity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardARPANET%2Fdjango-simple-activity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardARPANET%2Fdjango-simple-activity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardARPANET%2Fdjango-simple-activity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardARPANET%2Fdjango-simple-activity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richardARPANET","download_url":"https://codeload.github.com/richardARPANET/django-simple-activity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardARPANET%2Fdjango-simple-activity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32283294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: 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":["activity-stream","activity-streams","django","events","python","python-library","python2","python3"],"created_at":"2024-10-02T15:58:42.768Z","updated_at":"2026-04-26T01:31:28.504Z","avatar_url":"https://github.com/richardARPANET.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**NOTICE**: If you're reading this on GitHub.com please be aware this is a mirror of the primary remote located at https://code.richard.do/explore/projects.\nPlease direct issues and pull requests there.\n\ndjango-simple-activity\n======================\n\n[![PyPI](https://img.shields.io/pypi/v/django-simple-activity.svg)](https://pypi.python.org/pypi/django-simple-activity)\n[![Build Status](https://travis-ci.org/richardasaurus/django-simple-activity.png?branch=master)](https://travis-ci.org/richardasaurus/django-simple-activity)\n\n\nSimple, generic, activity streams from the actions on your site.\n\nSupports Django versions 1.10.x, 1.11.x, 2.0 and above.\n\n## Installation\n\n1. Install using `pip`...\n\n    ```pip install django-simple-activity```\n\n2. Add `'activity'` to your `INSTALLED_APPS` setting.\n\n    ```python\n    INSTALLED_APPS = (\n        ...\n        'activity',\n    )\n    ```\n\n3. Ensure `django.contrib.contenttypes` is above `django.contrib.auth` in your installed apps ([why? read here](http://stackoverflow.com/questions/25947951/genericforeignkey-violation-only-when-user-model-given-postgres/25949737#25949737)).\n\n\n## Example Usage\n\n\n#### Creating Activity Actions\n\n\n```python\nfrom activity.logic import add_action, get_action_text\nuser = User.objects.get(username='bob')\n\n# actor and verb example\naction = add_action(actor=user, verb='joined the website!')\nprint(get_action_text(action)) -\u003e 'bob joined the website!'\n\n# actor, verb and action\nanother_user = User.objects.get(username='jessica')\naction = add_action(\n    actor=user,\n    verb='made friends with',\n    action=another_user,\n    timestamp=timezone.now() - timedelta(days=2)\n)\nprint(get_action_text(action)) -\u003e 'bob made friends with jessica 2 days ago'\n\n```\nFurther examples are in the [tests](https://github.com/richardasaurus/django-simple-activity/blob/master/src/tests/test_activity.py).\n\n\n#### Retrieving Activity Actions\n\nGet **all** Activity Action records:\n\n```python\nAction.objects.all()\n```\n\n\nGet all **public** Activity Action records:\n```python\nAction.objects.public()\n```\n\nGet all **private** Activity Action records, where the actor is a given user\n\n```python\nAction.objects.private(actor=user)  # user being a Django User model instance\n```\n\nHere's an example use of `django-simple-activity` which uses [django signals](https://docs.djangoproject.com/en/dev/topics/signals/)\nto trigger off the creation of an activity action when a new user registers on the site.\n\n\n```python\nfrom django.db.models.signals import pre_save\nfrom django.dispatch import receiver\nfrom activity.logic import add_action\nfrom . models import UserProfile\n\n\n@receiver(pre_save, sender=UserProfile)\ndef new_user_activity(sender, **kwargs):\n    profile = kwargs.get('instance')\n    # if no profile.id yet, then this is a new user registering\n    if not profile.id:\n        add_action(actor=profile.user, verb='joined the website!')\n```\n\n\n## Running the unit tests\n\nTo test dependency installation and run the tests:\n\n```\npip install tox\ntox\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardarpanet%2Fdjango-simple-activity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichardarpanet%2Fdjango-simple-activity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardarpanet%2Fdjango-simple-activity/lists"}