{ "info": { "author": "Tom\u00e1\u0161 Ehrlich", "author_email": "tomas.ehrlich@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "django-deploy\n=============\n\nManagement command to automate deployment of django project using\ndistutils/setuptools.\n\nTL;DR\n=====\n\nI used to define set of actions to be run after `git pull` to update my project\nenvironment in various provisioning/deployment tools. However, since most of\nthese actions were just `manage.py` commands and since I've started to use setup\nscript I wanted to define these actions right there.\n\nWhat this app does\n------------------\n\nRun sequence of management commands or any python callable right after project\napp is installed or updated. It's intended to be used with setup script, but\ncan be also run separately.\n\nWhat this app does not\n----------------------\n\nRestarts http server, database or other services. Although one can define tasks\nwhich does one of these *root tasks*, this app isn't intended to do so. It's\nleft to other provisioning/deployment tools like Fabric, Salt or Ansible.\n\nUsage\n=====\n\n1. Install `django-deploy-setup` and add it into your requirements.\n\n2. Add `django_deploy` to your INSTALLED_APPS.\n\n3. Next step depends whether your project uses `setup.py` or not:\n\nWith ``setup.py``\n-----------------\n\nAdd custom install command to `cmdclass` argument in your setup.py:\n\n```python\nfrom django_deploy.setup import DjangoInstall as install\n\nsetup(\n ...\n cmdclass={'install': install},\n)\n```\n\n`DjangoInstall` will call `deploy` management command after regular install.\n\n*Please note:* `DJANGO_SETTINGS_MODULE` environment variable must be defined\nbefore running `python setup.py install` when using `DjangoInstall` command.\n\n### Problem with `install_requires`\n\nThis approach has one major flaw. In case you specify your\nproject requirements using `install_requires` keyword, you won't be able to\nimport `django_deploy` module during initial install.\n\nOne possible solution is add following import statement and install\napplication twice. Updates will work just fine:\n\n```python\ntry:\n from django_deploy.setup import DjangoInstall as install\nexcept ImportError:\n from distutils.command.install import install\n```\n\n\nWithout ``setup.py``\n--------------------\n\nSimply call `manage.py deploy` after updating codebase and\ninstalling requirements.\n\n\nDefault deployment tasks\n========================\n\nBy default, `deploy` command will run following commands:\n\n1. `syncdb` (if you're using Django < 1.7)\n2. `migrate` (if your're using south or Django > 1.7)\n3. `collectstatic` (if you're using `django.contrib.staticfiles`)\n4. `compilemessages` (if you're using internationalization, `I18N = True`)\n\nCustom deployment tasks\n=======================\n\nIf you want to run custom deployment tasks, create `deploy.py` file somewhere\nin your project directory and set `DEPLOY_TASKS` in settings as dotted path:\n\n```python\nDEPLOY_TASKS = 'project_name.deploy`\n```\n\nNext, create variable `tasks` as a list of `Task` instances:\n\n```python\n# project_name/deploy.py\n\ntasks = (\n Task('syncdb', interactive=False),\n Task('collectstatic', interactive=False),\n Task('compilemessages'),\n Task('custom_management_command'),\n)\n```\n\nTask definition\n---------------\n\nTo define task simply pass command_name, args and kwargs as you would for\n`django.core.management.call_command`.\n\n```python\nTask('syncdb', interactive=False)\n```\n\nis the same as:\n\n```python\ncall_command('syncdb', interactive=False)\n```\n\nThe difference is, that command defined via `Task` is executed using\n`run` method.\n\nCustom callable\n---------------\n\nIf you want to use custom callable instead of default ``call_command``, pass\n``custom_callable`` keyword argument:\n\n```python\nTask(custom_callable=my_command, kwarg=42)\n```\n\nLicence\n=======\n\nMIT", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/elvard/django-deploy", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-deploy-setup", "package_url": "https://pypi.org/project/django-deploy-setup/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-deploy-setup/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/elvard/django-deploy" }, "release_url": "https://pypi.org/project/django-deploy-setup/0.1.1a/", "requires_dist": null, "requires_python": null, "summary": "Deployment tools for django projects", "version": "0.1.1a" }, "last_serial": 1083653, "releases": { "0.1.1a": [ { "comment_text": "", "digests": { "md5": "0a273bf227fd422c24fb82bfdf7fe700", "sha256": "1ef165f4129d8d33e9071878b76b4b412ea32a68db2ef39c44050f732498f84e" }, "downloads": -1, "filename": "django-deploy-setup-0.1.1a.tar.gz", "has_sig": false, "md5_digest": "0a273bf227fd422c24fb82bfdf7fe700", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4590, "upload_time": "2014-05-07T04:43:39", "url": "https://files.pythonhosted.org/packages/e1/c8/671f93250dddc7d6b62a144cb326d34959783e4a14c59053a2e32a78f85b/django-deploy-setup-0.1.1a.tar.gz" } ], "0.1a": [ { "comment_text": "", "digests": { "md5": "e475f111ad430af1aa1bdf35db1f7892", "sha256": "7a5b5d4ce52e8475b1e30474303648712a453a9c2d013e70357813537b50fcf3" }, "downloads": -1, "filename": "django-deploy-setup-0.1a.tar.gz", "has_sig": false, "md5_digest": "e475f111ad430af1aa1bdf35db1f7892", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4607, "upload_time": "2014-05-03T06:30:16", "url": "https://files.pythonhosted.org/packages/f5/0c/88309513eae755c4cb9bd5b51133e0743618cfe918217e3776a8210f2ce4/django-deploy-setup-0.1a.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0a273bf227fd422c24fb82bfdf7fe700", "sha256": "1ef165f4129d8d33e9071878b76b4b412ea32a68db2ef39c44050f732498f84e" }, "downloads": -1, "filename": "django-deploy-setup-0.1.1a.tar.gz", "has_sig": false, "md5_digest": "0a273bf227fd422c24fb82bfdf7fe700", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4590, "upload_time": "2014-05-07T04:43:39", "url": "https://files.pythonhosted.org/packages/e1/c8/671f93250dddc7d6b62a144cb326d34959783e4a14c59053a2e32a78f85b/django-deploy-setup-0.1.1a.tar.gz" } ] }