{ "info": { "author": "Sebastian Phelps", "author_email": "sebastian.phelps@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# django-ini-settings\n\n\nThis library aims to be a non-intrusive configurable way of moving some local\nsettings out of the django settings.py and into a deployable .ini file\n\n## Quick-start\n\nInstall this library\n\n pip install django_ini_settings\n\nAdd the hook into your settings.py, if you want to use the default config\nmapping the following would do:\n\n from django_ini_settings.load import load_ini\n\n load_ini(ini_file=\"/etc/application/application.ini\",\n settings_module=sys.modules[__name__])\n\nThis implies that your ini file is located in /etc/application/application.ini\nFor example this ini might look like:\n\n [database]\n user = postgres\n password = secret\n\n [security]\n secret_key = !sfgr42325asdasd$34324\n debug = false\n\nTo insert custom configs you can either use the default format of the type as the group\nand the config name as the option. e.g.\n\n [string]\n custom_url = /custom/url\n\n [bool]\n feature_on = false\n\n [int]\n max_num_files = 120\n\nThis would be transformed to the following in your settings.py\n\n CUSTOM_URL = \"/custom/url\"\n FEATURE_ON = False\n MAX_NUM_FILES = 120\n\nYou can also provide your own mapping, including wildcards. e.g. add the\nfollowing in your settings\n\n\n from django_ini_settings.load import load_ini\n from django_ini_settings.settings_types import (DictItemSetting, StringSetting,\n BoolSetting, IntSetting)\n from django_ini_settings.statics import ANY, NAME_TO_UPPER\n\n CONFIG_FILE_MAPPING = {\n (\"database\", \"user\"): DictItemSetting((\"DATABASES\", \"default\", \"USER\")),\n (\"database\", \"password\"): DictItemSetting((\"DATABASES\", \"default\", \"PASSWORD\")),\n (\"database\", \"engine\"): DictItemSetting((\"DATABASES\", \"default\", \"ENGINE\")),\n (\"database\", \"name\"): DictItemSetting((\"DATABASES\", \"default\", \"NAME\")),\n (\"database\", \"host\"): DictItemSetting((\"DATABASES\", \"default\", \"HOST\")),\n (\"database\", \"port\"): DictItemSetting((\"DATABASES\", \"default\", \"PORT\")),\n (\"security\", \"secret_key\"): StringSetting(\"SECRET_KEY\"),\n (\"security\", \"debug\"): BoolSetting(\"DEBUG\"),\n (\"urls\", \"media_url\"): StringSetting(\"MEDIA_URL\"),\n (\"urls\", \"static_url\"): StringSetting(\"STATIC_URL\"),\n (\"application\", \"max_file_size\"): IntSetting(\"MAX_FILE_SIZE\"),\n (\"application\", ANY): StringSetting(NAME_TO_UPPER),\n }\n\n load_ini(ini_file=\"/etc/application/application.ini\",\n settings_module=sys.modules[__name__],\n config_mapping=CONFIG_FILE_MAPPING)\n\n## Environment Variables\n\nInstead of doing:\n\n load_ini(ini_file=\"/etc/application/application.ini\",\n settings_module=sys.modules[__name__])\n\nYou can also set an environment variable \"DJANGO_CONFIG_FILE\" containing the location of\nthe INI file. e.g.\n\n DJANGO_CONFIG_FILE=/etc/application/application.ini\n\nThen change the line to:\n\n load_ini(settings_module=sys.modules[__name__])\n\n## Tests\n\nTo run the tests, first make sure you have nose. If not then:\n\n pip install nose\n\nIf you have nose installed then from the same directory as this README:\n\n nosetests", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "django_ini_settings django local settings ini", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django_ini_settings", "package_url": "https://pypi.org/project/django_ini_settings/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django_ini_settings/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django_ini_settings/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A configurable way of moving some settings out of the django settings.py and into a deployable .ini file", "version": "0.1.0" }, "last_serial": 1745777, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2f64a48f8f2eafca510d4046da63cfb2", "sha256": "ce604ed5a9ef75a327a16852d3d5ce16cd9bb9f579a2c51dacbff9c107bf4533" }, "downloads": -1, "filename": "django_ini_settings-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2f64a48f8f2eafca510d4046da63cfb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4778, "upload_time": "2015-09-30T15:27:05", "url": "https://files.pythonhosted.org/packages/78/7f/52aebd5455eaf0091eb98f40cdcc99c45be448e0d04f46108873158c36e8/django_ini_settings-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "67d310a8424d8e8e4978c5a614b5c46e", "sha256": "94966ca27f272be2bc75027cf556a08ebc2a0ba4bf64b97ebb42d867ed475724" }, "downloads": -1, "filename": "django_ini_settings-0.1.0.tar.gz", "has_sig": false, "md5_digest": "67d310a8424d8e8e4978c5a614b5c46e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4745, "upload_time": "2015-09-30T15:35:25", "url": "https://files.pythonhosted.org/packages/52/7c/7f415207b072848e35ad16c20014539300bb4fc42ac7afb237e623e0dff2/django_ini_settings-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "67d310a8424d8e8e4978c5a614b5c46e", "sha256": "94966ca27f272be2bc75027cf556a08ebc2a0ba4bf64b97ebb42d867ed475724" }, "downloads": -1, "filename": "django_ini_settings-0.1.0.tar.gz", "has_sig": false, "md5_digest": "67d310a8424d8e8e4978c5a614b5c46e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4745, "upload_time": "2015-09-30T15:35:25", "url": "https://files.pythonhosted.org/packages/52/7c/7f415207b072848e35ad16c20014539300bb4fc42ac7afb237e623e0dff2/django_ini_settings-0.1.0.tar.gz" } ] }