{ "info": { "author": "Wyatt Baldwin", "author_email": "self@wyattbaldwin.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Local settings for Django projects\n\nThis package attempts to solve the problem of handling local settings in Django projects. Local\nsettings by definition can't be pre-defined, although perhaps they can have a reasonable default\nvalue (mainly useful for development). Another class of local settings are *secret* settings; these\ndefinitely shouldn't be pre-defined and should never be added to version control.\n\nThe problems with local settings are:\n\n- How to specify which settings are local\n- How to inform others which settings are local (or secret)\n- How to actually give the local settings a value\n- How to verify that local settings have been given a valid value\n- How to ensure new local settings get set\n- How to ensure local (and esp. secret) settings don't get added to version control\n\nOne common approach is to create a local settings template module with dummy/default values. When\nnew developers start working on a project, they copy this file (e.g., `local_settings.py.template\n=> local_settings.py`), which is typically excluded from version control. This approach at least\nidentifies which settings are local, but it's not very convenient with regard to setting values and\nensuring those values are valid. Also, instead of giving you a friendly heads-up when you forget to\nset a local setting, it barfs out an exception.\n\nThis package takes the approach that there will be only one settings *module* per project in the\nstandard location: `{project}.settings`. That module defines/overrides Django's base settings in\nthe usual way *plus* it defines which settings are local and which are secret.\n\nIn addition to the settings module, there will be one or more settings *files*. These are standard\nINI files with the added twist that the values are JSON encoded. The reasoning behind this is to\nuse a simple, standard config file format while still allowing for easy handling of non-string\nsettings.\n\nTODO: Maybe add support for different config file format (e.g., YAML)?\n\nOnce the local settings are defined, *any missing settings will be prompted for in the console*\n(with pretty colors and readline support).\n\n## Features\n\n- Missing local settings will be prompted for (only when running on a TTY/console)\n- Local settings can be defined with validators\n- Local settings can be defined with doc strings\n- Local settings can be nested in settings lists and dicts\n- Settings files can extend from each other\n- Settings values can be injected into other settings values using a special syntax (AKA\n interpolation, similar to the standard library's `configparser`)\n- Includes a script to easily generate local settings files for different environments\n- Supports Python 2.7 - 3.7 (using [six](http://pythonhosted.org/six/))\n- Supports Django 1.7 - 2.0\n\n## Basic usage\n\n- At the top of your project's settings module, import the `load_and_check_settings` function along\n with the types of settings you need:\n\n from local_settings import load_and_check_settings, LocalSetting, SecretSetting\n\n- Then define some base settings and local settings:\n\n PACKAGE = 'top_level_package_name'\n DEBUG = LocalSetting(default=False)\n DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql',\n 'NAME': LocalSetting(default='{{ PACKAGE }}'),\n 'USER': LocalSetting(''),\n 'PASSWORD': SecretSetting(),\n 'HOST': LocalSetting(''),\n 'PORT': '',\n },\n }\n SECRET_KEY = SecretSetting(doc='The secret key for doing secret stuff')\n\n As you can see, local settings can be defined anywhere within the definition of a top level\n setting. They can also have doc strings, which are displayed when prompting.\n\n This also demonstrates interpolation. The `DATABASES.default.NAME` setting will be replaced\n with the `PACKAGE` setting, so that its default value is effectively `'top_level_package'`.\n\n- After all the local settings are defined, add the following lines:\n\n _settings = load_and_check_settings(globals())\n globals().update(_settings)\n\n These two lines merge the project's local settings into the settings module's namespace.\n Passing `globals()` initializes the local settings loader with base settings (e.g., `PACKAGE`\n in the example above) and by \"telling\" it which settings are local settings.\n\n `load_and_check_settings()` loads the project's local settings from a file (`$PWD/local.cfg` by\n default), prompting for any that are missing, and returns a new dictionary with local settings\n merged over any base settings. When not running on a TTY/console, missing local settings will\n cause an exception to be raised.\n\n `globals().update(_settings)` merges all of the settings into the settings module's namespace.\n After this line runs, you will be able to use the local settings just like any other settings.\n For example, you could do `if DEBUG: ...`; at this point, `DEBUG` is no longer a `LocalSetting`\n instance--it's a regular old bool.\n\n Note: You could just write `globals().update(load_and_check_settings(globals()))`. The spelling\n above is just intended to make it more clear what's happening.\n\n- Now you can run any `manage.py` command, and you will be prompted to enter any missing local\n settings. On the first run, the settings file will be created. On subsequent runs when new local\n settings are added to the settings module, the settings file will be appended to.\n\n- Alternatively, you can run the included `make-local-settings` script to generate a local settings\n file.\n\n## Advanced usage\n\nTODO: Discuss using multiple settings files, extending a settings file from another file, how to\nspecify a settings file other than the default of `local.cfg`, editing settings files directly, &c.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wylee/django-local-settings", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-local-settings", "package_url": "https://pypi.org/project/django-local-settings/", "platform": "", "project_url": "https://pypi.org/project/django-local-settings/", "project_urls": { "Homepage": "https://github.com/wylee/django-local-settings" }, "release_url": "https://pypi.org/project/django-local-settings/1.0b10/", "requires_dist": null, "requires_python": "", "summary": "A system for dealing with local settings in Django projects", "version": "1.0b10" }, "last_serial": 5101238, "releases": { "1.0a1": [ { "comment_text": "", "digests": { "md5": "8e01113504efbe2f5b9cbabcfce99969", "sha256": "2802c168ad776692bc93933cb7936ac0deedc89ab67a9941804ac1702291c71f" }, "downloads": -1, "filename": "django-local-settings-1.0a1.tar.gz", "has_sig": false, "md5_digest": "8e01113504efbe2f5b9cbabcfce99969", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9085, "upload_time": "2015-03-12T00:14:10", "url": "https://files.pythonhosted.org/packages/eb/e5/60cc8a18f291b29ad984da402b729984279e3895715d4c5a73e654629889/django-local-settings-1.0a1.tar.gz" } ], "1.0a2": [ { "comment_text": "", "digests": { "md5": "315ca12baab8d844a4b4b9a16a01de6b", "sha256": "59235c9013ddf8a0ca7eceb729a93811bc976c872a415cecc24a7295a5d96966" }, "downloads": -1, "filename": "django-local-settings-1.0a2.tar.gz", "has_sig": false, "md5_digest": "315ca12baab8d844a4b4b9a16a01de6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13858, "upload_time": "2015-03-25T23:18:07", "url": "https://files.pythonhosted.org/packages/f5/3e/64f77f992c2e333571f92950e20e47e948bc8df9b58bbcd31421058df2d2/django-local-settings-1.0a2.tar.gz" } ], "1.0b10": [ { "comment_text": "", "digests": { "md5": "7aab308b404b478bbb1c4519518d4e48", "sha256": "2962ce9bca8d2c6b49e21e99b21195d5b4d4b012acc96208851f505cb1756e08" }, "downloads": -1, "filename": "django-local-settings-1.0b10.tar.gz", "has_sig": false, "md5_digest": "7aab308b404b478bbb1c4519518d4e48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25928, "upload_time": "2019-04-04T22:46:02", "url": "https://files.pythonhosted.org/packages/c2/34/6def2f488dcb4987b3f33720b0cff4cfdd22ce472d3833a080a25664e99b/django-local-settings-1.0b10.tar.gz" } ], "1.0b2": [ { "comment_text": "", "digests": { "md5": "3126b632a7425c97eab2107dc6216342", "sha256": "400ededf5792ebc0190b9b5654b39aa8ee8f6dcabaa0bc5ea6779ec672e3031b" }, "downloads": -1, "filename": "django-local-settings-1.0b2.tar.gz", "has_sig": false, "md5_digest": "3126b632a7425c97eab2107dc6216342", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22805, "upload_time": "2017-01-19T21:04:21", "url": "https://files.pythonhosted.org/packages/41/a5/d321ce356644d4a1b2201c5083805add2d18338108ec001f15c6d1b3dd1c/django-local-settings-1.0b2.tar.gz" } ], "1.0b4": [ { "comment_text": "", "digests": { "md5": "7c64f83c5ca186052bcf60ef3e9ba5cf", "sha256": "bf0e7f6368b8358b26f390dfbe490fedeec895c0ddea0e04e34e49540ba1a934" }, "downloads": -1, "filename": "django-local-settings-1.0b4.tar.gz", "has_sig": false, "md5_digest": "7c64f83c5ca186052bcf60ef3e9ba5cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23693, "upload_time": "2017-02-03T21:47:26", "url": "https://files.pythonhosted.org/packages/17/ce/c92a7bb8540ff77f54531754b5e285b8cfa7752c11fb523b606efbfe2f73/django-local-settings-1.0b4.tar.gz" } ], "1.0b5": [ { "comment_text": "", "digests": { "md5": "e91189d2338deb95206959ad35a2f5d5", "sha256": "cb9ef1ac3c2dab3c1c921beb609e1846a6ef66b9e88b3e41b59473d6202db6f6" }, "downloads": -1, "filename": "django-local-settings-1.0b5.tar.gz", "has_sig": false, "md5_digest": "e91189d2338deb95206959ad35a2f5d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24345, "upload_time": "2017-02-06T20:31:14", "url": "https://files.pythonhosted.org/packages/68/c3/ffd9a2937fa13f792e337d0df06c8bd646ad34de01df10cdef45dab7e1e7/django-local-settings-1.0b5.tar.gz" } ], "1.0b6": [ { "comment_text": "", "digests": { "md5": "7814c0173d7b3b1e740cda6884e70976", "sha256": "d67e3e17b78249a5fc9fd9ceb88df73431a1a96888df8e555c7ccbe902300276" }, "downloads": -1, "filename": "django-local-settings-1.0b6.tar.gz", "has_sig": false, "md5_digest": "7814c0173d7b3b1e740cda6884e70976", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25364, "upload_time": "2017-02-28T23:48:02", "url": "https://files.pythonhosted.org/packages/31/19/e158402bde4d78cdf90273eb69c81327d7574092922ffba257604b7defe4/django-local-settings-1.0b6.tar.gz" } ], "1.0b7": [ { "comment_text": "", "digests": { "md5": "765b5c4fe4718e60b03c56cbe0f26b99", "sha256": "03c19194765431ccda5790dc5a22cc1d7288dedbb5c82e51f35b9f549178a5e4" }, "downloads": -1, "filename": "django-local-settings-1.0b7.tar.gz", "has_sig": false, "md5_digest": "765b5c4fe4718e60b03c56cbe0f26b99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25681, "upload_time": "2017-07-06T17:56:30", "url": "https://files.pythonhosted.org/packages/86/ab/5289e03e17f5f5d17df8404770120e5a15081aa27f3c0e3cf643e15c5822/django-local-settings-1.0b7.tar.gz" } ], "1.0b8": [ { "comment_text": "", "digests": { "md5": "37e61a677757949683cdf226425a52fa", "sha256": "337d20d4ee1a1f670180e3c417b857f33a3b50ca295d2cac9cc9300c6d0a03c8" }, "downloads": -1, "filename": "django-local-settings-1.0b8.tar.gz", "has_sig": false, "md5_digest": "37e61a677757949683cdf226425a52fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25943, "upload_time": "2018-01-13T23:58:00", "url": "https://files.pythonhosted.org/packages/da/86/34e230af8c14208bd6caea9cfd2e6e06ccf3db0863dde3bf634acb0b465c/django-local-settings-1.0b8.tar.gz" } ], "1.0b9": [ { "comment_text": "", "digests": { "md5": "ff92ca9212c4223cf601d2efce3511e9", "sha256": "2e5198d92f8707c33dcd0580f1ccf2691b5c5d90dc95add451be4b95db6f0021" }, "downloads": -1, "filename": "django-local-settings-1.0b9.tar.gz", "has_sig": false, "md5_digest": "ff92ca9212c4223cf601d2efce3511e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24929, "upload_time": "2018-10-09T00:39:50", "url": "https://files.pythonhosted.org/packages/a6/70/4e746a7823288aace53e74f0296d8305656bf451a8c39687f6d452ff727e/django-local-settings-1.0b9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7aab308b404b478bbb1c4519518d4e48", "sha256": "2962ce9bca8d2c6b49e21e99b21195d5b4d4b012acc96208851f505cb1756e08" }, "downloads": -1, "filename": "django-local-settings-1.0b10.tar.gz", "has_sig": false, "md5_digest": "7aab308b404b478bbb1c4519518d4e48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25928, "upload_time": "2019-04-04T22:46:02", "url": "https://files.pythonhosted.org/packages/c2/34/6def2f488dcb4987b3f33720b0cff4cfdd22ce472d3833a080a25664e99b/django-local-settings-1.0b10.tar.gz" } ] }