{"id":16061333,"url":"https://github.com/akx/django-managerie","last_synced_at":"2025-05-09T00:00:38.719Z","repository":{"id":37251583,"uuid":"107032430","full_name":"akx/django-managerie","owner":"akx","description":"Expose Django management commands in the admin","archived":false,"fork":false,"pushed_at":"2025-03-05T11:53:24.000Z","size":88,"stargazers_count":87,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-07T18:17:23.621Z","etag":null,"topics":["admin","django","management"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/akx.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2017-10-15T17:13:47.000Z","updated_at":"2025-05-03T11:27:07.000Z","dependencies_parsed_at":"2024-10-10T22:45:52.643Z","dependency_job_id":null,"html_url":"https://github.com/akx/django-managerie","commit_stats":{"total_commits":50,"total_committers":3,"mean_commits":"16.666666666666668","dds":"0.040000000000000036","last_synced_commit":"27751db95298ee157241ff8b5cb4a0199f000ecc"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akx%2Fdjango-managerie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akx%2Fdjango-managerie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akx%2Fdjango-managerie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akx%2Fdjango-managerie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akx","download_url":"https://codeload.github.com/akx/django-managerie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166502,"owners_count":21864475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["admin","django","management"],"created_at":"2024-10-09T04:08:41.202Z","updated_at":"2025-05-09T00:00:38.690Z","avatar_url":"https://github.com/akx.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![pypi](https://img.shields.io/pypi/v/django-managerie.svg)](https://pypi.python.org/pypi/django-managerie/)\n\n# django-managerie\n\n:lightbulb: Expose Django management commands as forms in the admin, like so:\n\n![Screenshot](./screenshot.png)\n\n## Requirements\n\n- Django 4.2+ (this project tracks Django's end-of-life policy)\n- Python 3.10+\n\n## Installation\n\nInstall the package as you would any Python package, then add `django_managerie` to your `INSTALLED_APPS`.\n\n### Automatic patching\n\nThis is the easiest way to get up and running.\nYou can have Managerie patch the admin site's dashboard view to include pseudo-models with the name \"Commands\"\nfor all apps where management commands are available, and while it's at it, it'll also include URLs of its own.\n\nHook up Managerie to your admin site (e.g. in `urls.py`, where you have `admin.autodiscover()`), like so:\n\n```python\nfrom django.contrib import admin\nfrom django_managerie import Managerie\n# ...\nmanagerie = Managerie(admin_site=admin.site)\nmanagerie.patch()\n```\n\n### No patching\n\nThis is likely safer (in the presence of slightly less tolerant 3rd party apps that mangle the admin, for instance),\nbut you can't enjoy the luxury of the Commands buttons in the admin dashboard.\n\n```python\nfrom django.contrib import admin\nfrom django.conf.urls import include, url\nfrom django_managerie import Managerie\n# ...\nmanagerie = Managerie(admin_site=admin.site)\n# ...\nurlpatterns = [\n    # ...\n    # ... url(r'^admin/', include(admin.site.urls)), ...\n    url(r'^admin/', include(managerie.urls)),  # Add this!\n]\n```\n\n## Usage\n\nIf you allowed Managerie to patch your admin, superusers can now see `Commands` \"objects\" in the admin dashboard.\nIf you didn't patch the admin, you can access a list of all commands through `/admin/managerie/`\n(or wherever your admin is mounted).\n\nIf you click through to a command, you'll see the arguments of the command laid out as a form.\nFill the form, then hit \"Execute Command\", and you're done! :sparkles:\n\n### Accessing the Django request from a managerie'd command\n\nManagerie sets `_managerie_request` on the command instance to the current Django request.\nYou can use it to access the request, for instance, to get the current user.\n\n### Accessing standard input\n\nBy default, Managerie will patch `sys.stdin` to be an empty stream.\nIf you need to read from standard input (e.g. long input),\nset the `managerie_accepts_stdin` attribute on your command class to `True`.\n\nThis will cause Managerie to add a text-area to the form, which will be passed to the command as standard input.\n\nNote that `sys.stdin.buffer` (binary mode) is not supported.\n\n## TODO\n\n- More `argparse` action support\n- Multiple-argument support (`nargs`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakx%2Fdjango-managerie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakx%2Fdjango-managerie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakx%2Fdjango-managerie/lists"}