{ "info": { "author": "Axiomatic LLC", "author_email": "contact@axiomatic.im", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "# django-encrypted-secrets\n\n[![CircleCI](https://img.shields.io/circleci/project/github/nzaillian/django-encrypted-secrets/development.svg?style=popout)](https://circleci.com/gh/nzaillian/django-encrypted-secrets/tree/development) [![Django Versions](https://img.shields.io/pypi/djversions/django-encrypted-secrets.svg?style=popout)](https://www.djangoproject.com/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/django-encrypted-secrets.svg?color=rgb%2868%2C%20204%2C%2017%29&style=popout)](https://www.python.org)\n\n`django-encrypted-secrets` brings [Rails-style credential encryption](https://edgeguides.rubyonrails.org/security.html#custom-credentials) to the [Django web framework](https://www.djangoproject.com/).\n\n## Installation\n\nTo install `django-encrypted-secrets`, first pip install the module:\n\n $ pip install django-encrypted-secrets\n\n\nAdd `encrypted_secrets` to INSTALLED_APPS in your django settings file:\n\n INSTALLED_APPS = [\n ...\n 'encrypted_secrets'\n ]\n\nFinally, you must call `load_secrets()` from within your `manage.py` and `wsgi.py` files:\n\n\n```\n#!/usr/bin/env python\nimport os\nimport sys\nfrom encrypted_secrets import load_secrets\n\nif __name__ == \"__main__\":\n load_secrets()\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"yourapp.settings\")\n # ...\n```\n\n## Usage\n\n`django-encrypted-secrets` works by using a key (stored locally in `master.key` file or read from the environment variable `DJANGO_MASTER_KEY`) and reading/writing secrets to the encrypted file `secrets.yml.enc`.\n\n ./manage.py init_secrets\n\nYou can edit the secrets by running:\n\n ./manage.py edit_secrets\n\nWhen you save the file in your editor, its contents are encrypted and used to overwrite the `secrets.yml.enc` file.\n\nFinally, to read secrets within your codebase, use the `get_secret` utility:\n\n```\nfrom encrypted_secrets import get_secret\n\n# ...\n\nsecret_api_key = get_secret(\"secret_api_key\")\n\n````\n\nYou should always keep your `master.key` file `.gitignored`.\n\n## env mode (experimental)\n\n`django-encrypted-secrets` experimentally supports loading key-value pairs from an encrypted file written in the [dotenv](https://github.com/theskumar/python-dotenv) format directly into the environment. To use this style of variable loading, you must pass `env_mode=True` to your `load_secrets` call in `manage.py` and `wsgi.py`:\n\n```\n#!/usr/bin/env python\nimport os\nimport sys\nfrom encrypted_secrets import load_secrets\n\nif __name__ == \"__main__\":\n load_secrets(env_mode=True) # <- important\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"yourapp.settings\")\n # ...\n```\n\nYou must also pass the `--mode=env` flag to the `init_secrets` management command when initializing `django-encrypted-secrets`:\n\n```\n$ ./manage.py init_secrets --mode=env\n```\n\nA template encrypted dotenv-type file will be written to `secrets.env.enc`. When using env mode, secrets are automatically added to the environment. This means that, in addition to being able to read secrets using the `get_secret` helper method, you may also read them as ordinary environment variables. If an environment variable configured in the file already exists in the environment, it will *not* be overriden. This is because we assume that you may want to override variables from `django-encrypted-secrets` with environment variables set in your deployment environment.\n\nExample of reading environment variables directly from the environment and using `get_secret`:\n\n```\nimport os\nfrom encrypted_secrets import get_secret\n\n# option 1 - read directly from the environment:\nsecret_api_key = os.environ.get('SECRET_API_KEY')\n\n# option 2 - use get_secret:\nsecret_api_key = get_secret('SECRET_API_KEY')\n```\n\n## Production considerations\n\n`django-encrypted-secrets` looks for the encrypted secrets file within the current working directory from which you execute management commands (using `os.getcwd()`). This is implicitly the project root directory. Depending on your production server configuration, `os.getcwd()` may not actully return the project root. For production, we therefore recommend you explicitly set a `DJANGO_SECRETS_ROOT` environment variable pointing to the project root to hint to `django-encrypted-secrets` where it should look for the encrypted secrets file.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nzaillian/django-encrypted-secrets", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-encrypted-secrets", "package_url": "https://pypi.org/project/django-encrypted-secrets/", "platform": "", "project_url": "https://pypi.org/project/django-encrypted-secrets/", "project_urls": { "Homepage": "https://github.com/nzaillian/django-encrypted-secrets" }, "release_url": "https://pypi.org/project/django-encrypted-secrets/0.9.7/", "requires_dist": null, "requires_python": "", "summary": "A Django app for managing secrets.", "version": "0.9.7" }, "last_serial": 5894948, "releases": { "0.8": [ { "comment_text": "", "digests": { "md5": "5c5bd9ab4302e214b95f5f74f3f5451f", "sha256": "501689a83ed5ce329ef228478e0b6786bb85ff9734f1e2ce7638dacff84b6c08" }, "downloads": -1, "filename": "django-encrypted-secrets-0.8.tar.gz", "has_sig": false, "md5_digest": "5c5bd9ab4302e214b95f5f74f3f5451f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4915, "upload_time": "2019-04-19T09:57:00", "url": "https://files.pythonhosted.org/packages/55/07/2d1b5066c264465af98f8759bc77ff6c873d31f42eb8c7dc951c0dce299f/django-encrypted-secrets-0.8.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "4821bbe097454ba36e905a8457364216", "sha256": "dc6e9f990a6528224e97a26e6b28abc1223b997535f5e4acf119939d63deedb5" }, "downloads": -1, "filename": "django-encrypted-secrets-0.8.1.tar.gz", "has_sig": false, "md5_digest": "4821bbe097454ba36e905a8457364216", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5337, "upload_time": "2019-04-19T10:06:28", "url": "https://files.pythonhosted.org/packages/88/7c/69f44e8eb086865c414badb2d5ecfd2d5acdaa77a1fe032d6ac3e24ec2ae/django-encrypted-secrets-0.8.1.tar.gz" } ], "0.8.2": [ { "comment_text": "", "digests": { "md5": "66cb67b828c510fab042764ecb9b8dad", "sha256": "5a8a9050ef2018acd6ac9f291a6823861cefac4f7f99a27abe0ab358b4cf2096" }, "downloads": -1, "filename": "django-encrypted-secrets-0.8.2.tar.gz", "has_sig": false, "md5_digest": "66cb67b828c510fab042764ecb9b8dad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6017, "upload_time": "2019-04-19T10:12:18", "url": "https://files.pythonhosted.org/packages/eb/4c/7cdc8e5cd0a804b077f5b5814c31a116b905cb6cb7b27eccb895f37bd571/django-encrypted-secrets-0.8.2.tar.gz" } ], "0.8.3": [ { "comment_text": "", "digests": { "md5": "e0821b936b0064ba400598cec7a1a41f", "sha256": "6d47af9a869d110467e7d669c1764829e48f689693c2483d26de5fda8bc40350" }, "downloads": -1, "filename": "django-encrypted-secrets-0.8.3.tar.gz", "has_sig": false, "md5_digest": "e0821b936b0064ba400598cec7a1a41f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6280, "upload_time": "2019-04-19T10:21:38", "url": "https://files.pythonhosted.org/packages/24/a3/3e5a25b0fd4fcc0ec2501c10d142dc58294ba0f8feb0d993f4a6d00402d6/django-encrypted-secrets-0.8.3.tar.gz" } ], "0.8.4": [ { "comment_text": "", "digests": { "md5": "1bd1da67f993bc32cec32b7006ba5ab8", "sha256": "da3555b03348a5c9e8cb3c5e2694878b7be076113d390c919674eb7daa253bc6" }, "downloads": -1, "filename": "django-encrypted-secrets-0.8.4.tar.gz", "has_sig": false, "md5_digest": "1bd1da67f993bc32cec32b7006ba5ab8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6281, "upload_time": "2019-04-19T10:35:20", "url": "https://files.pythonhosted.org/packages/19/21/893c475ee56638df5ff775675982afb169fe6df28db9de9d227cde6c3f76/django-encrypted-secrets-0.8.4.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "232eefc2d042dc3a99f38df809619921", "sha256": "91a6b337d2909594685f93a9ef89300d08b92ef5c57188e0e4b6fd3d124f41df" }, "downloads": -1, "filename": "django_encrypted_secrets-0.9.0-py3-none-any.whl", "has_sig": false, "md5_digest": "232eefc2d042dc3a99f38df809619921", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9820, "upload_time": "2019-05-05T15:59:33", "url": "https://files.pythonhosted.org/packages/49/ef/2d0c7f7d05419e1780a48b479ff6a1eb01a04145baad6ac8809b61cebd99/django_encrypted_secrets-0.9.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bab85e29f917649cc5e7da7687e1f069", "sha256": "bcadb2626d3ad142e196ab9fddb94072276ac29f9ecd2b35b2ff15f07dcc14ec" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.0.tar.gz", "has_sig": false, "md5_digest": "bab85e29f917649cc5e7da7687e1f069", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6118, "upload_time": "2019-05-05T15:59:36", "url": "https://files.pythonhosted.org/packages/9d/4d/c08ed26158e25fe2c5afc10154acf36890eec3c17db312859b4bd0ae760b/django-encrypted-secrets-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "ffae44538fbc22f2211d3b32d40e7c47", "sha256": "d77afafd9602eea28ce4c3c99df83f895a432f6d70ee5ba509f1872b9cdd2940" }, "downloads": -1, "filename": "django_encrypted_secrets-0.9.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ffae44538fbc22f2211d3b32d40e7c47", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10173, "upload_time": "2019-05-05T16:02:22", "url": "https://files.pythonhosted.org/packages/44/6a/d1a06eb2ba0e8eae2d1245d08c5888dfa7e75223e20303547b769770fcfa/django_encrypted_secrets-0.9.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19a4fce66e9dc43519ff6bb36f0e5385", "sha256": "8a65f9a9a833114fec45d6c117c0aa2fadfbfd707e83f481d7a2c1177136899f" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.1.tar.gz", "has_sig": false, "md5_digest": "19a4fce66e9dc43519ff6bb36f0e5385", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6513, "upload_time": "2019-05-05T16:02:26", "url": "https://files.pythonhosted.org/packages/0f/cb/0fb572ccf2599c17a9e18971322a82d165a5170eb86a998433d9c3784857/django-encrypted-secrets-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "6b8e6833771060662daaec5292e71328", "sha256": "1d8f08be6c3fc066cac29a25f30af9bf6c8596de86329e38a9ef1afdaf294d80" }, "downloads": -1, "filename": "django_encrypted_secrets-0.9.2-py3-none-any.whl", "has_sig": false, "md5_digest": "6b8e6833771060662daaec5292e71328", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10442, "upload_time": "2019-05-05T18:30:54", "url": "https://files.pythonhosted.org/packages/ce/d4/031d616741f3faa1c12e8ffb3ca9633f2698d04731ba0fe4baf14e6ac0f6/django_encrypted_secrets-0.9.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9bc376f1d6b88793e2b76229b66d8eb", "sha256": "c1c56ed4d07e1d5050f61dfe832a48baf3015897ac6f48a3e01f8b80adb5c1c3" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.2.tar.gz", "has_sig": false, "md5_digest": "d9bc376f1d6b88793e2b76229b66d8eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6775, "upload_time": "2019-05-05T18:30:59", "url": "https://files.pythonhosted.org/packages/55/11/1652761f609942c043126e2327b7c07f8cfb09d7c4a324475e801cc0f199/django-encrypted-secrets-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "ef0b4885d43a5e652b4f5f58cb5d06d6", "sha256": "10b3af0620bc8953a2f7c49b4f6b13878907ce962f9b33ada856ac075fe649be" }, "downloads": -1, "filename": "django_encrypted_secrets-0.9.3-py3-none-any.whl", "has_sig": false, "md5_digest": "ef0b4885d43a5e652b4f5f58cb5d06d6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10440, "upload_time": "2019-05-05T19:12:01", "url": "https://files.pythonhosted.org/packages/f0/ce/1bc46d6c9a2b3c1c5f31dedaf39188743d288442a16a338e91eddee621b6/django_encrypted_secrets-0.9.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4892b5c7ef98b77ce014ee0b67472a86", "sha256": "6aae0bdcca6ed5bcf8c557e145f46f78a86a28e7fa8b868f91288d1a1e48f5e9" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.3.tar.gz", "has_sig": false, "md5_digest": "4892b5c7ef98b77ce014ee0b67472a86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6777, "upload_time": "2019-05-05T19:12:06", "url": "https://files.pythonhosted.org/packages/5f/43/abf483f180afca5b9be15f969cd70df5193b8d9c634b94206c4637af4916/django-encrypted-secrets-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "f016e1d5f5d82becb87c9008ac62d67f", "sha256": "6c246473d67d2d1c0522d992abbfdd2db1d5ad0a9648c68c2cde23cb8b3a33d0" }, "downloads": -1, "filename": "django_encrypted_secrets-0.9.4-py3-none-any.whl", "has_sig": false, "md5_digest": "f016e1d5f5d82becb87c9008ac62d67f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10646, "upload_time": "2019-05-07T21:52:07", "url": "https://files.pythonhosted.org/packages/08/4f/8b713459b48cd87e9dba81982a0d3717bb4b101057b06b167ad05ba3d4f1/django_encrypted_secrets-0.9.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b4df94a8ace6f42b7e1efa6a20050fef", "sha256": "46668a040edbe4d3098f92fc82da93ca89372a071ee6a8416703ad38b8adc615" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.4.tar.gz", "has_sig": false, "md5_digest": "b4df94a8ace6f42b7e1efa6a20050fef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7075, "upload_time": "2019-05-07T21:52:12", "url": "https://files.pythonhosted.org/packages/1c/79/f133da3c7b4c4f636925063e676e94ddc58f50d4fea9c8c779c75d1992ad/django-encrypted-secrets-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "f617a5413b294f711f5ab3b5e7f38db5", "sha256": "f0b6230d5ec67cb253c97bfc507e203b9a1ebf98c993e423e671c5302fa4bcce" }, "downloads": -1, "filename": "django_encrypted_secrets-0.9.5-py3-none-any.whl", "has_sig": false, "md5_digest": "f617a5413b294f711f5ab3b5e7f38db5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10587, "upload_time": "2019-05-07T22:02:34", "url": "https://files.pythonhosted.org/packages/3c/6c/b3b2c442a0c27ac3ac85bcba86a324203f9fcfd3092e5ffdf8db627fb773/django_encrypted_secrets-0.9.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "002d92e65732b7038a8b390f5615162c", "sha256": "1b0ec58959b3c3bf78bf23627a786c7beedc9d32964509e1ae6385ddbd1bd3ba" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.5.tar.gz", "has_sig": false, "md5_digest": "002d92e65732b7038a8b390f5615162c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7016, "upload_time": "2019-05-07T22:02:40", "url": "https://files.pythonhosted.org/packages/32/cd/65d6b90251fd12a29289c13fb6ae9a373a98ffd8e5d69f77208c083f13e8/django-encrypted-secrets-0.9.5.tar.gz" } ], "0.9.6": [ { "comment_text": "", "digests": { "md5": "ac891839b9d8da520ae42c539b87aa0e", "sha256": "da439ad47d0a4a4f644db6e75c6affcd6c25deca987a030dab70991aa4965053" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.6.tar.gz", "has_sig": false, "md5_digest": "ac891839b9d8da520ae42c539b87aa0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7011, "upload_time": "2019-09-13T07:53:06", "url": "https://files.pythonhosted.org/packages/ae/a7/a9615cfcbc4b45cf707f44822d0438beaf701aa6e1009e6aafcf3c4ce7d7/django-encrypted-secrets-0.9.6.tar.gz" } ], "0.9.7": [ { "comment_text": "", "digests": { "md5": "5392dabf142b2565278e9d9dd5462df2", "sha256": "3d725fb3920c63f1b07746b9016314708e621e199b6fab5d15dec20534857bc9" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.7.tar.gz", "has_sig": false, "md5_digest": "5392dabf142b2565278e9d9dd5462df2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7721, "upload_time": "2019-09-27T08:54:08", "url": "https://files.pythonhosted.org/packages/7f/e5/7252885d5b20ce1763aef928065fd98cf7ad31dcf2ec75ffc7b6844402b0/django-encrypted-secrets-0.9.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5392dabf142b2565278e9d9dd5462df2", "sha256": "3d725fb3920c63f1b07746b9016314708e621e199b6fab5d15dec20534857bc9" }, "downloads": -1, "filename": "django-encrypted-secrets-0.9.7.tar.gz", "has_sig": false, "md5_digest": "5392dabf142b2565278e9d9dd5462df2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7721, "upload_time": "2019-09-27T08:54:08", "url": "https://files.pythonhosted.org/packages/7f/e5/7252885d5b20ce1763aef928065fd98cf7ad31dcf2ec75ffc7b6844402b0/django-encrypted-secrets-0.9.7.tar.gz" } ] }