{"id":46734558,"url":"https://github.com/zsoldosp/django-currentuser","last_synced_at":"2026-03-09T16:49:29.735Z","repository":{"id":20121282,"uuid":"88029039","full_name":"zsoldosp/django-currentuser","owner":"zsoldosp","description":"Conveniently store reference to request user on thread/db level.","archived":false,"fork":false,"pushed_at":"2025-05-14T07:41:26.000Z","size":114,"stargazers_count":178,"open_issues_count":18,"forks_count":43,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-11-16T22:09:02.831Z","etag":null,"topics":["django","pip","threads","user"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zsoldosp.png","metadata":{"files":{"readme":"README.rst","changelog":null,"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,"zenodo":null}},"created_at":"2017-04-12T08:35:56.000Z","updated_at":"2025-11-06T21:05:54.000Z","dependencies_parsed_at":"2024-06-18T15:15:03.114Z","dependency_job_id":"268a0f84-6b27-4ad7-b964-4e7ef352f1d1","html_url":"https://github.com/zsoldosp/django-currentuser","commit_stats":null,"previous_names":["paesslerag/django-currentuser"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/zsoldosp/django-currentuser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsoldosp%2Fdjango-currentuser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsoldosp%2Fdjango-currentuser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsoldosp%2Fdjango-currentuser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsoldosp%2Fdjango-currentuser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zsoldosp","download_url":"https://codeload.github.com/zsoldosp/django-currentuser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsoldosp%2Fdjango-currentuser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30302950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"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":["django","pip","threads","user"],"created_at":"2026-03-09T16:49:29.113Z","updated_at":"2026-03-09T16:49:29.723Z","avatar_url":"https://github.com/zsoldosp.png","language":"Python","readme":"=============================\ndjango-currentuser\n=============================\n\n.. contents:: Conveniently store reference to request user on thread/db level.\n\nQuickstart\n----------\n\nInstall django-currentuser::\n\n    pip install django-currentuser\n\nNote: if there is a new Django version released that the library hasn't been\nupgraded to support yet, e.g.:\n\n    The conflict is caused by:\n        The user requested django==5.1\n        django-currentuser 0.8.0 depends on Django\u003c5.1 and \u003e=4.2\n\nyou can try to install it with the unsupported/untested Django version by\nusing the `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` environment variable\n\n    DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO=1 pip install django-currentuser\n\nAde it to the middleware classes in your settings.py::\n\n    MIDDLEWARE = (\n        ...,\n        'django_currentuser.middleware.ThreadLocalUserMiddleware',\n    )\n\nThen use it in a project::\n\n    from django_currentuser.middleware import (\n        get_current_user, get_current_authenticated_user)\n\n    # As model field:\n    from django_currentuser.db.models import CurrentUserField\n    class Foo(models.Model):\n        created_by = CurrentUserField()\n        updated_by = CurrentUserField(on_update=True)\n\n\nDifferences to django-cuser\n---------------------------\n\nBoth libraries serve the same purpose, but be aware of these\ndifferences (as of django-cuser v.2017.3.16):\n\n- django-currentuser's CurrentUserField stores the reference to the request user\n  at initialization of the model instance and still allows you to overwrite the\n  value before saving. django-cuser sets the value in the pre_save handler\n  of the field just before writing it to the database. Intermediate changes\n  will be ignored.\n\n- django-cuser deletes the user reference from the thread after finishing a\n  response and it will therefore no longer be available for testing purposes.\n\nSupported Versions\n------------------\n* for django-currentuser`, fixes are always made against the latest version\n* for Python, support is guided by https://devguide.python.org/versions/#supported-versions\n* for Django, support is guided by\n  https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django\n  and https://www.djangoproject.com/download/#supported-versions (assuming the Python version\n  listed there is supported)\n\nNote on [semver](https://semver.org/): While the fact that Django support stopped for version\nX, doesn't have to mean it's a breaking change for this lib, as it would be just a\nbackward-compatible metadata patch, no code change. However, at some point support needs to be\ndropped - so for simplicity, the project follows what Django supports. If someone needs to use\ndifferent, unsupported version, `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` allows for it.\n\nRelease Notes\n-------------\n\n* 0.10.0\n\n  * by @adiorz\n  * add support for Python 3.14\n  * add support for Django 6.0\n  * drop support for Python 3.9\n  * drop support for Django 5.1\n\n* 0.9.0\n\n  * by @bartvanandel\n  * add support for Python 3.13\n  * add support for Django 5.2\n  * drop support for Python 3.8\n  * drop support for Django 5.0\n\n* 0.8.0\n\n  * add support for Django 5.1\n  * drop support for Django 3.2\n  * introduce `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` environment variable\n    to make upgrades easier\n\n* 0.7.0\n\n  * add support for Django 5.0\n  * add support for Python 3.12\n  * drop support for Django 4.0 and 4.1\n\n* 0.6.1\n\n  * remove project transfer warning from README in order not to scare people away from the project\n\n* 0.6.0\n\n  * add support for Django 4.0, 4.1, and 4.2\n  * add support for Python 3.11\n  * drop support for Python 3.6 and 3.7\n\n* 0.5.3 - add support for Django 3.2 and Python 3.9\n\n* 0.5.2 - Fixed Django deprecation warning about using `ugettext_lazy()`\n\n* 0.5.1 - add support for Django 3.1 and Python 3.8\n\n* 0.5.0\n  - add support for update on save (thank you @felubra)\n  - no longer build on Python 3.5, deprecated\n\n* 0.4.3 - add support for Django 3.0\n\n* 0.4.2 - Minor fix for supported Django and Python versions\n\n* 0.4.0 - update supported versions\n\n  - drop support for Python 3.4\n  - drop support for Django 2.0\n  - add support for Python 3.7\n  - add support for Django 2.2\n  - update tox3travis.py to not loose deployment feature\n\n* 0.3.4 - Use public Travis for packaging to remove dependency on outdated build\n  system\n* 0.3.3 - drop Python 3.7 support due to build process problems\n* 0.3.1 - attempt to add Python 3.7 support\n* 0.3.0 - update supported versions according to\n  https://www.djangoproject.com/download/#supported-versions and\n  https://devguide.python.org/#status-of-python-branches\n\n  - drop support for Python 3.2\n\n* 0.2.3 - support custom user model, drop Django 1.10 support\n* 0.2.2 - support Django 2.0\n* 0.2.1 - version fixes #9\n\n  - support Django 1.11.x and not just 1.11.0\n\n* 0.2.0 - New middleclass format\n\n  - Adapt to new object based middle class format of Django 1.10+\n  - Drop support for deprecated Django versions 1.8 and 1.9\n\n* 0.1.1 - minor release\n\n  - suppress warning for passed kwargs as long as they match the defaults (avoids them being printed during running tests when fields are cloned)\n\n* 0.1.0 - initial release\n\n  - provides middleware + methods to set + retrieve reference of currently logged in user from thread\n  - provides CurrentUserField that by default stores the currently logged in user\n  - supports Django 1.10, 1.11 on python 2.7, 3.4, 3.5, and 3.6 - as per the `official django docs \u003chttps://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django\u003e`_\n\n\n.. contributing start\n\nContributing\n------------\n\nAs an open source project, we welcome contributions.\n\nThe code lives on `github \u003chttps://github.com/zsoldosp/django-currentuser\u003e`_.\n\nReporting issues/improvements\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPlease open an `issue on github \u003chttps://github.com/zsoldosp/django-currentuser/issues/\u003e`_\nor provide a `pull request \u003chttps://github.com/zsoldosp/django-currentuser/pulls/\u003e`_\nwhether for code or for the documentation.\n\nFor non-trivial changes, we kindly ask you to open an issue, as it might be rejected.\nHowever, if the diff of a pull request better illustrates the point, feel free to make\nit a pull request anyway.\n\nPull Requests\n~~~~~~~~~~~~~\n\n* for code changes\n\n  * it must have tests covering the change. You might be asked to cover missing scenarios\n  * the latest ``flake8`` will be run and shouldn't produce any warning\n  * if the change is significant enough, documentation has to be provided\n\nTo trigger the packaging, run `make release` on the master branch with a changed\nversion number.\n\nSetting up all Python versions\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n    sudo apt-get -y install software-properties-common\n    sudo add-apt-repository ppa:deadsnakes/ppa\n    sudo apt-get update\n    for version in 3.10 3.11 3.12 3.13 3.14; do\n      py=python$version\n      if ! which ${py}; then\n        sudo apt-get -y install ${py} ${py}-dev\n      fi\n    done\n    sudo add-apt-repository --remove ppa:deadsnakes/ppa\n    sudo apt-get update\n\nCode of Conduct\n~~~~~~~~~~~~~~~\n\nAs it is a Django extension, it follows\n`Django's own Code of Conduct \u003chttps://www.djangoproject.com/conduct/\u003e`_.\nAs there is no mailing list yet, please use `github issues`_\n\nContributors\n~~~~~~~~~~~~\nCurrent maintainer: @zsoldosp\nInitial development \u0026 maintenance: @PaesslerAG\n\nFor contributors, see `github contributors`_.\n\n\n.. contributing end\n\n\n.. _github contributors: https://github.com/zsoldosp/django-currentuser/graphs/contributors\n.. _github issues: https://github.com/zsoldosp/django-currentuser/issues\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsoldosp%2Fdjango-currentuser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzsoldosp%2Fdjango-currentuser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsoldosp%2Fdjango-currentuser/lists"}