{ "info": { "author": "Jaakko Kantoj\u00e4rvi", "author_email": "jaakko@n-1.fi", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Django settings dict\n====================\n\nThis is small helper that makes it easier to store distributable django app settings in project :code:`settings.py` as a dict.\nPurpose is to keep settings file simple and clean.\nWith this it's also easier to set defaults for the settings and warn about settings that have been removed.\n\nHelper also supports marking settings that should be imported before returning.\nImport is done using :code:`django.utils.module_loading.import_string`.\n\nHelper resolves variables when requested for the first time and caches the value for faster lookup next time.\nVariables that are not in :code:`required` or :code:`defaults` raise :code:`AttributeError`.\nIf you like to clear the cache, you can use :code:`_clear_cached()`.\n\nUsing ``migrate``, you can configure list of migration actions.\nParameter takes a list of tuples, where first field is the new setting name, second is the old name outside of the dictionary and optional third is callable.\nThe callable has format ``migrate_script(old_value: Any, current_dictionary: dict) -> Any``, where ``current_dictionary`` contains all values read so far.\n\nDesign is based on class done in `Django REST framework `_.\n\n\nExample\n-------\n\nSetting defitions in your applications :code:`app_settings.py` (for example):\n\n.. code-block:: python\n\n from django_settingsdict import SettingsDict\n REQUIRED = (\n 'IMPORTANT_SETTING',\n )\n DEFAULTS = {\n 'URL_NAME': 'test_app',\n 'MIGRATED_VALUE': 'something old, but supported',\n 'REVERSE_FUNC': 'django.core.urlresolvers.reverse',\n }\n IMPORT_STRINGS = (\n 'REVERSE_FUNC',\n )\n REMOVED = (\n 'OLD_SETTING',\n )\n MIGRATE = (\n ('MIGRATED_VALUE', 'MY_APP_OLD_OPTION'),\n )\n app_settings = SettingsDict('MY_APP',\n required=REQUIRED,\n defaults=DEFAULTS,\n removed=REMOVED,\n migrate=MIGRATE,\n import_strings=IMPORT_STRINGS)\n\nConfiguration in your projects :code:`settings.py`:\n\n.. code-block:: python\n\n MY_APP = {\n 'IMPORTANT_SETTING': 'some value',\n 'URL_NAME': 'test_app_2',\n }\n MY_APP_OLD_OPTION = 'this is not fixed yet'\n\nAnd in your application code:\n\n.. code-block:: python\n\n from .app_settings import app_settings\n\n print(app_settings.IMPORTANT_SETTING)\n print(app_settings.URL_NAME)\n print(app_settings.REVERSE_FUNC)\n print(app_settings.MIGRATED_VALUE)\n\nwould make following result:\n\n.. code-block::\n\n some value\n test_app_2\n \n this is not fixed yet\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/raphendyr/django-settingsdict/archive/1.1.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/raphendyr/django-settingsdict", "keywords": "django settings", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-settingsdict", "package_url": "https://pypi.org/project/django-settingsdict/", "platform": "", "project_url": "https://pypi.org/project/django-settingsdict/", "project_urls": { "Download": "https://github.com/raphendyr/django-settingsdict/archive/1.1.1.tar.gz", "Homepage": "https://github.com/raphendyr/django-settingsdict" }, "release_url": "https://pypi.org/project/django-settingsdict/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "Simple helper class to handle dict style settings for django app", "version": "1.1.1" }, "last_serial": 5599600, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "651e6ab3b5e74f33dff552fb006d5eb0", "sha256": "7ed2a048ad09dd6ba6a61bf98c398d3a86a68a177644fbe47dc65dc38e6624fc" }, "downloads": -1, "filename": "django-settingsdict-1.0.0.tar.gz", "has_sig": false, "md5_digest": "651e6ab3b5e74f33dff552fb006d5eb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4492, "upload_time": "2016-10-17T13:11:34", "url": "https://files.pythonhosted.org/packages/a8/c6/7fa92e9ddb9d59d81424438a13832caf3fb591545ac1a906cd4f8c57db02/django-settingsdict-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "6c956c30480eadccdab095ab648addfa", "sha256": "58a7ca7719f0049f3554fb75ee692ceb6c12aaee2c30b5c1c48bc995cdf6ca3d" }, "downloads": -1, "filename": "django-settingsdict-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6c956c30480eadccdab095ab648addfa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4498, "upload_time": "2017-06-30T22:40:27", "url": "https://files.pythonhosted.org/packages/de/c4/ef363db3e495d0a4e96fe72270ddb62aefebe2242444dc0aa408575880de/django-settingsdict-1.0.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "c1fa56d60b907fab1fac856c4ae398e5", "sha256": "83c21018d71a64a6906e173548178dc2c523c611a451fd3af4df8fdf7ce5e33d" }, "downloads": -1, "filename": "django_settingsdict-1.1.1-py3.7.egg", "has_sig": false, "md5_digest": "c1fa56d60b907fab1fac856c4ae398e5", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 6351, "upload_time": "2019-07-29T13:46:52", "url": "https://files.pythonhosted.org/packages/7f/57/e06eb47c7bf97d30be928c14dea892a479f390afb079cc27c16cf47de8a9/django_settingsdict-1.1.1-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "1bc624c82d5b713673bcb6588cc711c3", "sha256": "4fd2ab750a239b2a16ef086bca1937ad677b3137e97eaeec61a36b39368bb173" }, "downloads": -1, "filename": "django_settingsdict-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1bc624c82d5b713673bcb6588cc711c3", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 5040, "upload_time": "2019-07-29T13:48:00", "url": "https://files.pythonhosted.org/packages/1e/30/d89ec036aab6951f61e4bcff34c6cb4622865b2eab0f802d6e7cad396c7c/django_settingsdict-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "78c92cb0c33a1463ec8950b62225b59d", "sha256": "6d06f565dfe3645d4a15f6104f3c4be36085bd600f8e15473bcb5e0c66ed229d" }, "downloads": -1, "filename": "django-settingsdict-1.1.1.tar.gz", "has_sig": false, "md5_digest": "78c92cb0c33a1463ec8950b62225b59d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5156, "upload_time": "2019-07-29T13:46:50", "url": "https://files.pythonhosted.org/packages/d5/7f/42c599138cfeace16a81ffa3bb6cbe19a3464cacf28fc8abeb74dd9f0749/django-settingsdict-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c1fa56d60b907fab1fac856c4ae398e5", "sha256": "83c21018d71a64a6906e173548178dc2c523c611a451fd3af4df8fdf7ce5e33d" }, "downloads": -1, "filename": "django_settingsdict-1.1.1-py3.7.egg", "has_sig": false, "md5_digest": "c1fa56d60b907fab1fac856c4ae398e5", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 6351, "upload_time": "2019-07-29T13:46:52", "url": "https://files.pythonhosted.org/packages/7f/57/e06eb47c7bf97d30be928c14dea892a479f390afb079cc27c16cf47de8a9/django_settingsdict-1.1.1-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "1bc624c82d5b713673bcb6588cc711c3", "sha256": "4fd2ab750a239b2a16ef086bca1937ad677b3137e97eaeec61a36b39368bb173" }, "downloads": -1, "filename": "django_settingsdict-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1bc624c82d5b713673bcb6588cc711c3", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 5040, "upload_time": "2019-07-29T13:48:00", "url": "https://files.pythonhosted.org/packages/1e/30/d89ec036aab6951f61e4bcff34c6cb4622865b2eab0f802d6e7cad396c7c/django_settingsdict-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "78c92cb0c33a1463ec8950b62225b59d", "sha256": "6d06f565dfe3645d4a15f6104f3c4be36085bd600f8e15473bcb5e0c66ed229d" }, "downloads": -1, "filename": "django-settingsdict-1.1.1.tar.gz", "has_sig": false, "md5_digest": "78c92cb0c33a1463ec8950b62225b59d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5156, "upload_time": "2019-07-29T13:46:50", "url": "https://files.pythonhosted.org/packages/d5/7f/42c599138cfeace16a81ffa3bb6cbe19a3464cacf28fc8abeb74dd9f0749/django-settingsdict-1.1.1.tar.gz" } ] }