{ "info": { "author": "Brett Haydon", "author_email": "brett@haydon.id.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2 :: Only", "Topic :: Software Development" ], "description": "Djset\n=====\n\nDjset simplifies managing secrets in your django settings.\n\nA common django configuration pattern is to use environment variables in production environments with a local unversioned settings file to hold your secret development api keys and other settings. Djset simplifies management of secret settings locally by using the shell environ, system keyring, and optionally user prompted settings.\n\nDjset is a convenience layer on top of the python keyring library.\n\n\nInstallation\n---------------\n\nDjset currently requires python >= 2.6. There are currently some outstanding issues with python keyring on python 3::\n\n pip install djset\n\nTo install the optional environment variable helpers (in OSX or Linux) put ``source dexportunset.sh`` in your postactivate script if you use virtualenvwrapper or in your shell startup file if you don't.\n\nDjset is entirely dependent on the DJANGO_SETTINGS_MODULE variable being set in the environment. You can use the virtualenvwrapper postactivate and postdeactivate scripts to export and unset this variable for your project.\n\n\nUsage\n-------- \nIn your settings.py add something like the following::\n\n from djset import secret as s\n \n s.prompt = DEBUG\n SECRET_KEY = s.get('SECRET_KEY') \n\nThe key is resolved in the following order::\n\n environment\n |\n keychain in the NAME.keyring namespace (local)\n |\n keychain in the KEY.keyring namespace (global)\n |\n prompt for input or raise ImproperlyConfigured\n \nPrompt will also *add* the key to your keyring. \n\nA common practice is to set some sensible defaults for development including for example your SECRET_KEY. Djset provides for this with a twist on dict.get behaviour. \n\n``SECRET_KEY = s.get('SECRET_KEY', prompt_default='xyz')`` or just ``SECRET_KEY = s.get('SECRET_KEY', 'xyz')`` will set the default value the user is prompted with, but if prompt=False will still raise an ImproperlyConfigured error which is more useful for an automated deployment. An additional optional argument ``prompt_help`` can help the user make a decision. This might be useful if you are distributing a project template for others to use.\n\nBy default the *NAME* in the namespace is your DJANGO_SETTINGS_MODULE. To use an alternate namespace:: \n\n s.name = 'your.settings'\n\nTo add and remove keys use the command line::\n\n djsecret add = [--global] [--name= | --settings=]\n djsecret remove [--global] [--name= | --settings=]\n\nNote::\n\n OSX and Gnome don't have an api for removing keys so on those platforms the value is cleared.\n\n\nAll commands trigger a django runserver reload by changing the modified time on the settings file.\n\nOrdinary setting management\n----------------------------\n\nDjset has one other keyring backend for non-sensitive settings which will be stored in keyring_public.cfg at ~/.local/share/ or \"$USERPROFILE/Local Settings\" on Windows. Usage is identical except it wont raise an ImproperlyConfigured error by default::\n\n from djset import config as c\n \n tz_help = \"\"\"\n Local time zone for this installation. Choices can be found here:\n http://en.wikipedia.org/wiki/List_of_tz_zones_by_name\n \"\"\"\n TIME_ZONE = c.get('TIME_ZONE', 'UTC', tz_help)\n \nTo add and remove keys use the command line::\n\n djconfig add = [--global] [--name= | --settings=]\n djconfig remove [--global] [--name= | --settings=]\n\n\nAn alternative/complement to storing settings is to export it to the current environment. The following commands (OSX & Linux only) behave the same as shell export and unset but also trigger the reload::\n\n dexport =\n dunset \n \n \nCustomisation\n--------------\n\nSet your own keyring backend by overriding the DjSecret or DjConfig keyring attribute with your own keyring instance::\n\n from keyring.backends.file import PlaintextKeyring\n from djset import DjSecret\n DjSecret.keyring = PlaintextKeyring()\n s = DjSecret()\n\nDevelopment & Support\n----------------------\nRequires Nose2 for tests. Repository and issues at https://github.com/bretth/djset", "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/bretth/djset", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "djset", "package_url": "https://pypi.org/project/djset/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/djset/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bretth/djset" }, "release_url": "https://pypi.org/project/djset/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Utilities for Django settings secrets", "version": "0.2.2" }, "last_serial": 791226, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "549697c0be9b463cf2070e768be71065", "sha256": "9b8fcba9e650348c9428561422e3fc228e62db9fe5710f9a7059f7bf65535cdb" }, "downloads": -1, "filename": "djset-0.1.1.tar.gz", "has_sig": false, "md5_digest": "549697c0be9b463cf2070e768be71065", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2627, "upload_time": "2013-02-04T08:52:50", "url": "https://files.pythonhosted.org/packages/07/74/0a7d114fd99b18fb398d94555e15155e130a7a402b18f29f68bf86c381ae/djset-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "be1401b2ac0f184fc343ee4a5f4c0680", "sha256": "2058ad9b5f2900a63826c7a9d2d5e5014b4282d88faf0714ea19396e36d54eca" }, "downloads": -1, "filename": "djset-0.1.2.tar.gz", "has_sig": false, "md5_digest": "be1401b2ac0f184fc343ee4a5f4c0680", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8789, "upload_time": "2013-02-04T10:15:56", "url": "https://files.pythonhosted.org/packages/d4/6b/6f8393a831ca33b03f1a8feb4cf765927d2a20427bb439a29809679627f7/djset-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "3540c1d6f1c8ddac7f9a1a67d99c376d", "sha256": "d4b25a98d2a5c2a038ba72f007ef072940bdfb90b17b2aa8e4068ea656202d0d" }, "downloads": -1, "filename": "djset-0.1.3.tar.gz", "has_sig": false, "md5_digest": "3540c1d6f1c8ddac7f9a1a67d99c376d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8971, "upload_time": "2013-02-07T01:29:45", "url": "https://files.pythonhosted.org/packages/11/dd/1f8c758bd13d56f03dae5311632ef23927904adfa2844890ad58f70f7140/djset-0.1.3.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "42ed3a0323b86781cd55813c42a75781", "sha256": "7aaeb47aedd0a747fd4c12bd71ccd6309329829b8502979e4a999bab28d68a66" }, "downloads": -1, "filename": "djset-0.2.tar.gz", "has_sig": false, "md5_digest": "42ed3a0323b86781cd55813c42a75781", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10323, "upload_time": "2013-02-10T03:07:50", "url": "https://files.pythonhosted.org/packages/0f/6f/a8386a0d550bc2f6f90ec318123217e25bcfdd9eae1287f4a64cc0b23ee2/djset-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "8f382623c66988d681ef2cb8ac531c62", "sha256": "c64f9d8d1cdd605970833157a55db2cf78ca5c4bd68dc7789e605234b738e4fd" }, "downloads": -1, "filename": "djset-0.2.1.tar.gz", "has_sig": false, "md5_digest": "8f382623c66988d681ef2cb8ac531c62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12185, "upload_time": "2013-02-10T07:53:52", "url": "https://files.pythonhosted.org/packages/e5/32/8062f092f49e28267c6aa8f3bb18b0775ffc5becc843d6e0a6096a0d72fd/djset-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "7543344c05180fdffdd586842509d3d6", "sha256": "8fc017d7804a015b502a5896b6208f6a4fc15fdbc5cf837ba36bc9eedb2681c3" }, "downloads": -1, "filename": "djset-0.2.2.tar.gz", "has_sig": false, "md5_digest": "7543344c05180fdffdd586842509d3d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10823, "upload_time": "2013-02-19T21:54:33", "url": "https://files.pythonhosted.org/packages/6c/f6/a4e0bc9d253a0915c02374b12c2874920f25a81dd3db732ec2e0cd983e59/djset-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7543344c05180fdffdd586842509d3d6", "sha256": "8fc017d7804a015b502a5896b6208f6a4fc15fdbc5cf837ba36bc9eedb2681c3" }, "downloads": -1, "filename": "djset-0.2.2.tar.gz", "has_sig": false, "md5_digest": "7543344c05180fdffdd586842509d3d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10823, "upload_time": "2013-02-19T21:54:33", "url": "https://files.pythonhosted.org/packages/6c/f6/a4e0bc9d253a0915c02374b12c2874920f25a81dd3db732ec2e0cd983e59/djset-0.2.2.tar.gz" } ] }