{ "info": { "author": "Anto59290", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "# Django-AdminCommand \n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n\nDjango-AdminCommand is a Django application that makes it possible\nto run Django management commands from the admin.\n\n## Contributions\n\nThis is an enhanced fork, see the original repo: https://github.com/liberation/django-admincommand\n\nFirst author: `Djaz Team`, with commits from @amirouche, @diox, @lauxley\n\nDjango 1.11 compatibility pull request taken from @mgaitan : https://github.com/liberation/django-admincommand/pull/10\n\n\n\n## Dependencies\n\n - django-async (not mandatory)\n - django-sneak\n\n\n## Installation\n\nFor now you can only clone this repo and run `python setup.py develop` (sudo if needed) to setup Django AdminCommand.\n\n(Soon on PyPi)\n\n## Settings\n\n\nYou need to activate the Django admin in the settings and ``urls.py``\ndepending on your needs the configuration may vary, refer\nto the Django documentation related to the\n[`admin application`](https://docs.djangoproject.com/en/dev/ref/contrib/admin/).\n\nDon't forget to add the application where you defined management\ncommands in the list of installed applications. This might be already\ndone but it might not be the case if you use an application to gather\nall the management commands that must be admin commands.\n\n\n## Make magic happens\n\n\nCreate a Django Management Command::\n\n```py\n# ./music/management/commands/lyrics.py\n\n\nclass Command(BaseCommand):\n help = \"Compute lyrics based an bitorological fluctuations\"\n\n def handle(self, *args, **options):\n # algorithm that generated lyrics based on a title and a dictionary\n```\n\nThen you will have to create a configuration class for the command::\n\n```py\n# ./music/admincommands.py\n\nfrom admincommand.models import AdminCommand\n\n\nclass Lyrics(AdminCommand):\n\n pass\n```\n\n*NOTE*: This all works based on naming conventions. The file with the form must be called `admincommands` and the form class name must be the same as the management command file name (with camel case converted to underscore notation).\n(This will probably change to settings based property in upcoming days)\n\nAnd all is well, the new admin command will be available under the\n\u00abAdmin Command\u00bb area of the administration of the default admin site.\n\nIf you use custom admin site, don't forget to register\n``admincommand.models.AdminCommand`` to the admin site object.\n\n\n## Forms\n\nForms for the options are build by running an inspection of the command argument (default to bool / checkbox).\nIf the form does not seems correct for your management command, please check the `type` option in your management command.\n\n\n## Logs\n\nLogs emitted using the Django (and Python) logging module will be printed on the result page of the admin. They will still go into the normal logging process.\n\n\n## Compatibility\n\nThis module was tested and is designed for Django 1.11, may work with other versions\n\n## Permissions\n\nYou MUST add to every user or groups that should have access to the list of commands\n\u00abCan change admincommand\u00bb permission. Every admin command gets it's own permission\n\u00abCan Run AnAdminCommand\u00bb, so you can add it to proper users or group. Users will\nonly see and be able to execute admin commands for which they have the permission.\n\n\n## Asynchronous tasks\n\n**This is not actively supported for now, use at your own risk**\n\nIf you want to execute commands asynchronously you have to\nspecify it in the AdminCommand configuration class with the\n``asynchronous`` property set to ``True``::\n\n```py\n# ./music/admincommands.py\n\nfrom admincommands.models import AdminCommand\n\n\nclass Fugue(AdminCommand):\n\n asynchronous = True\n\n class form(forms.Form):\n title = forms.CharField()\n\n def get_command_arguments(self, forms_data):\n return [forms_data['title']], {}\n```\n\n\nYou also need to run periodically ``flush_queue`` from ``django-async`` application for that matter don't forget to install the application.\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/BackMarket/django-admincommand", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-admincommand", "package_url": "https://pypi.org/project/django-admincommand/", "platform": "", "project_url": "https://pypi.org/project/django-admincommand/", "project_urls": { "Homepage": "https://github.com/BackMarket/django-admincommand" }, "release_url": "https://pypi.org/project/django-admincommand/0.1.6/", "requires_dist": [ "django-sneak" ], "requires_python": "", "summary": "Execute management commands from the Django admin", "version": "0.1.6" }, "last_serial": 4304064, "releases": { "0.1.6": [ { "comment_text": "", "digests": { "md5": "5689057af2cfc053d2b7358466d9ef82", "sha256": "2dc2cf0058dc1f49af6622fdcd53ddc0bf5b4c4ba2af1d42ab57f74404d4d518" }, "downloads": -1, "filename": "django_admincommand-0.1.6-py2-none-any.whl", "has_sig": false, "md5_digest": "5689057af2cfc053d2b7358466d9ef82", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11023, "upload_time": "2018-09-24T09:22:58", "url": "https://files.pythonhosted.org/packages/cb/b4/b32609351f06f5b3ddafd536c9df677a2210f090e6204ed0a79edbddc768/django_admincommand-0.1.6-py2-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5689057af2cfc053d2b7358466d9ef82", "sha256": "2dc2cf0058dc1f49af6622fdcd53ddc0bf5b4c4ba2af1d42ab57f74404d4d518" }, "downloads": -1, "filename": "django_admincommand-0.1.6-py2-none-any.whl", "has_sig": false, "md5_digest": "5689057af2cfc053d2b7358466d9ef82", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11023, "upload_time": "2018-09-24T09:22:58", "url": "https://files.pythonhosted.org/packages/cb/b4/b32609351f06f5b3ddafd536c9df677a2210f090e6204ed0a79edbddc768/django_admincommand-0.1.6-py2-none-any.whl" } ] }