{"id":31333306,"url":"https://github.com/realorangeone/django-generic-relation-db-repro","last_synced_at":"2026-05-18T09:06:23.259Z","repository":{"id":293087243,"uuid":"982902196","full_name":"RealOrangeOne/django-generic-relation-db-repro","owner":"RealOrangeOne","description":"A repository to reproduce a bug with modifying generic relations, where the wrong database connection is used.","archived":false,"fork":false,"pushed_at":"2025-05-13T15:39:06.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-05T20:46:18.478Z","etag":null,"topics":["bug","django"],"latest_commit_sha":null,"homepage":"https://code.djangoproject.com/ticket/36389","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RealOrangeOne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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},"funding":{"github":"RealOrangeOne","ko_fi":"theorangeone","liberapay":"theorangeone","custom":["https://theorangeone.net/support/"]}},"created_at":"2025-05-13T15:15:04.000Z","updated_at":"2025-05-14T14:06:08.000Z","dependencies_parsed_at":"2025-05-13T16:44:21.139Z","dependency_job_id":"dcce253c-bd77-403b-8186-c65d51fd4ccb","html_url":"https://github.com/RealOrangeOne/django-generic-relation-db-repro","commit_stats":null,"previous_names":["realorangeone/django-generic-relation-db-repro"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RealOrangeOne/django-generic-relation-db-repro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealOrangeOne%2Fdjango-generic-relation-db-repro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealOrangeOne%2Fdjango-generic-relation-db-repro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealOrangeOne%2Fdjango-generic-relation-db-repro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealOrangeOne%2Fdjango-generic-relation-db-repro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RealOrangeOne","download_url":"https://codeload.github.com/RealOrangeOne/django-generic-relation-db-repro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealOrangeOne%2Fdjango-generic-relation-db-repro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33172173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"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":["bug","django"],"created_at":"2025-09-26T01:41:27.111Z","updated_at":"2026-05-18T09:06:23.239Z","avatar_url":"https://github.com/RealOrangeOne.png","language":"Python","funding_links":["https://github.com/sponsors/RealOrangeOne","https://ko-fi.com/theorangeone","https://liberapay.com/theorangeone","https://theorangeone.net/support/"],"categories":[],"sub_categories":[],"readme":"# Django generic relation reproduction\n\nA repository to reproduce a bug with modifying generic relations, where the wrong database connection is used.\n\nConfirmed on Django 4.2, 5.0, 5.1 and 5.2.\n\n# Usage\n\n```\nuv venv\nuv pip install django\n.venv/bin/python ./manage.py test\n```\n\nWhen running the tests, they'll fail. The failure shows queries being executed against the replica connection. Since they're `UPDATE` queries, they should run against the \"default\" connection, instead.\n\n# Steps to recreate\n\n1. `django-admin startproject`\n2. Create second database connection, pointing to the same database, but using MIRROR in tests.\n3. Create a database router to use the secondary connection for reads and the default for writes (see `db_router.py`).\n4. Create 2 models, with a generic relationship between them (see `models.py`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealorangeone%2Fdjango-generic-relation-db-repro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealorangeone%2Fdjango-generic-relation-db-repro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealorangeone%2Fdjango-generic-relation-db-repro/lists"}