{ "info": { "author": "Jakub Roztocil", "author_email": "jakub@roztocil.co", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "``django-settings-export``\n##########################\n\n\n|version| |travis| |coverage|\n\n\nOften it is needed to make some of your Django project's settings\naccessible from within templates. This app provides a simple mechanism\nfor doing just that.\n\n\n**Principles:**\n\n* *Explicit is better than implicit:* Only explicitly listed\n settings keys are exported to templates.\n* *Errors should never pass silently:* Accessing an undefined\n or unexported setting key from a template results in an exception.\n\n\nTested on Python 2.7+, Django 1.5+.\n\n\nInstallation\n============\n\n.. code-block:: bash\n\n $ pip install django-settings-export\n\n\nAdd ``'django_settings_export.settings_export'`` to\ntemplate context processor list in your ``settings.py``:\n\n**Django 1.8 and newer:**\n\n.. code-block:: python\n\n TEMPLATES = [\n {\n # \u2026\n 'OPTIONS': {\n 'context_processors': [\n # \u2026\n 'django_settings_export.settings_export',\n ],\n },\n },\n ]\n\n**Django older than 1.8:**\n\n.. code-block:: python\n\n TEMPLATE_CONTEXT_PROCESSORS = [\n # [...]\n 'django_settings_export.settings_export',\n ]\n\n\n\nUsage\n=====\n\nAll settings that should be made accessible from templates need to be\nexplicitly listed in ``settings.SETTINGS_EXPORT``:\n\n\n.. code-block:: python\n\n # settings.py\n\n DEBUG = True\n GA_ID = 'UA-00000-0'\n\n SETTINGS_EXPORT = [\n 'DEBUG',\n 'GA_ID',\n ]\n\n\n\nNow you can access those exported settings from your templates\nvia ``settings.``:\n\n\n.. code-block:: html\n\n \n\n {% if not settings.DEBUG %}\n \n {% endif %}\n\n\nThe ``settings`` variable is an instance of ``dict`` subclass, so\nyou use all the methods ``dict`` provides. For example, you can iterate over\nthe keys and values using , ``settings.keys``, ``settings.values``,\n``settings.items``, etc:\n\n.. code-block:: html\n\n {% for key, value in settings.items %}\n {{ key }}: {{ value }}\n {% endfor %}\n\n\nChanging the ``settings`` variable name\n---------------------------------------\n\nIf you wish to change the name of the context variable to something besides\n``settings``, add ``SETTINGS_EXPORT_VARIABLE_NAME = 'custom_name'``\nto your ``settings.py``. This is useful when some other plugin is already adding\n``settings`` to your template contexts.\n\n\n.. code-block:: python\n\n # settings.py\n FOO = 'bar'\n SETTINGS_EXPORT = ['FOO']\n SETTINGS_EXPORT_VARIABLE_NAME = 'my_config'\n\n\n\n.. code-block:: html\n\n \n\n {{ my_config.FOO }}\n\n\nExceptions\n----------\n\nThese custom exceptions can be thrown:\n\n* Listing an undefined setting key in ``SETTINGS_EXPORT`` results in an\n ``UndefinedSettingError``.\n* Accessing a unexported setting key on the ``settings`` object in a template\n results in an ``UnexportedSettingError``.\n\nAll subclass from ``django_settings_export.SettingsExportError``.\n\n\n\n\nDemo & Tests\n------------\n\nSee the source code of the bundled\n`demo app `_.\n\n\nDevelopment\n===========\n\n.. code-block:: bash\n\n $ cd tests\n\n # Run demo\n $ python manage.py runserver\n\n # Run tests on current Python\n $ python manage.py test\n\n # Run tests on all Pythons\n $ tox\n\n\nChange Log\n==========\n\nSee `CHANGELOG `_.\n\n\nLicence\n=======\n\nBSD. See `LICENCE `_ for more details.\n\n\nContact\n=======\n\n\nJakub Roztocil\n\n* http://roztocil.co\n* https://github.com/jkbrzt\n* https://twitter.com/jkbrzt\n\n\n.. |travis| image:: https://api.travis-ci.org/jkbrzt/django-settings-export.svg\n :target: http://travis-ci.org/jkbrzt/django-settings-export\n :alt: Build Status of the master branch\n\n\n.. |version| image:: https://badge.fury.io/py/django-settings-export.svg\n :target: https://pypi.python.org/pypi/django-settings-export\n :alt: PyPi\n\n.. |coverage| image:: https://img.shields.io/coveralls/jkbrzt/django-settings-export.svg?branch=master\n :target: https://coveralls.io/r/jkbrzt/django-settings-export?branch=master\n :alt: Coverage\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jkbrzt/django-settings-export", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-settings-export", "package_url": "https://pypi.org/project/django-settings-export/", "platform": "", "project_url": "https://pypi.org/project/django-settings-export/", "project_urls": { "Homepage": "https://github.com/jkbrzt/django-settings-export" }, "release_url": "https://pypi.org/project/django-settings-export/1.2.1/", "requires_dist": null, "requires_python": "", "summary": "This Django app allows you to export certain settings to your templates.", "version": "1.2.1" }, "last_serial": 2445304, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "03438789c2daf3399a01d8e5556baa1f", "sha256": "4555a070e6fe11ec1d445c23ef60100333016319d0f9bdf772e48fc807361632" }, "downloads": -1, "filename": "django-settings-export-1.0.tar.gz", "has_sig": false, "md5_digest": "03438789c2daf3399a01d8e5556baa1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2692, "upload_time": "2014-09-14T17:29:31", "url": "https://files.pythonhosted.org/packages/5c/d4/b405da718201918180f1baad60d381e25c50490df85f23add1f8147a552d/django-settings-export-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "dfe45239598ee79f832d6fe7f58c1ea0", "sha256": "b809a232e3beaae2ecad194f2c493f23bdc06c0394e6f22d2a114dcda2adc83c" }, "downloads": -1, "filename": "django-settings-export-1.0.1.tar.gz", "has_sig": false, "md5_digest": "dfe45239598ee79f832d6fe7f58c1ea0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3501, "upload_time": "2014-09-14T17:31:03", "url": "https://files.pythonhosted.org/packages/47/d3/3ca5b7b383b41ab27707cb7a66d6c69b59eeb895bf4b39a8962c5b373ca3/django-settings-export-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "153fb8998a6966af1156b40399561e96", "sha256": "af7aa0a32bfb74564ef207b0e8159817e990f180ce3d156a605acac6a5962478" }, "downloads": -1, "filename": "django-settings-export-1.0.2.tar.gz", "has_sig": false, "md5_digest": "153fb8998a6966af1156b40399561e96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3505, "upload_time": "2014-09-14T17:33:42", "url": "https://files.pythonhosted.org/packages/b8/09/82dee9056d56fae04cbc3da087a53616de519dbc50964329502c9453a6eb/django-settings-export-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "99dc93a989e8030965be907ae855ae34", "sha256": "022e0d3cd27b8efa719d699fa01f9aea1462b81e4587aeb643023dccabd77494" }, "downloads": -1, "filename": "django-settings-export-1.0.3.tar.gz", "has_sig": false, "md5_digest": "99dc93a989e8030965be907ae855ae34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3529, "upload_time": "2014-09-14T17:58:16", "url": "https://files.pythonhosted.org/packages/c5/8a/6f1f1fa4290b5f7d49ce081c63698e9fb102cb843e92203f52a29eb80991/django-settings-export-1.0.3.tar.gz" } ], "1.0.4": [], "1.0.5": [ { "comment_text": "", "digests": { "md5": "e1b0c9db2e2354c43463bd7a3f5c1da2", "sha256": "2b802c502c56ce317ea33a0e03521402acecf3d228ddbafe81a5cde70ab90254" }, "downloads": -1, "filename": "django_settings_export-1.0.5-py2-none-any.whl", "has_sig": false, "md5_digest": "e1b0c9db2e2354c43463bd7a3f5c1da2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5324, "upload_time": "2015-07-03T19:43:56", "url": "https://files.pythonhosted.org/packages/78/89/b282b0baad886662a3362defa03305d61c13ca4a2ac3702c04b315e80637/django_settings_export-1.0.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2914c53a55111b7417e87445402a428", "sha256": "9882af82fdfa43926d8ea73426f277a347c2fd0795a7d0e95eff6aee2e6539b7" }, "downloads": -1, "filename": "django-settings-export-1.0.5.tar.gz", "has_sig": false, "md5_digest": "b2914c53a55111b7417e87445402a428", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4008, "upload_time": "2015-07-03T19:44:04", "url": "https://files.pythonhosted.org/packages/6e/1a/39d70e43849a9edd2ed781a9ce0b773a6a80af382054aa253293673e5afd/django-settings-export-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "89352236abddd375d591db3efec92a24", "sha256": "e775c3a72e13dceef19ea942ce8cf73230ac9c209c5bafbf137719c0c3880dc4" }, "downloads": -1, "filename": "django_settings_export-1.0.6-py2-none-any.whl", "has_sig": false, "md5_digest": "89352236abddd375d591db3efec92a24", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5341, "upload_time": "2015-09-15T22:51:48", "url": "https://files.pythonhosted.org/packages/09/ac/26688c6f91b9116591cb438001c24b9086c9316c3b4603e63c6a7991b247/django_settings_export-1.0.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df365cf9c0dd7078db10bc2b7aa9110a", "sha256": "e2f7f2dc82c02902f5b6a3b3bb7600760540b875e63bcb018f1c3049cf02e9a6" }, "downloads": -1, "filename": "django-settings-export-1.0.6.tar.gz", "has_sig": false, "md5_digest": "df365cf9c0dd7078db10bc2b7aa9110a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4050, "upload_time": "2015-09-15T22:51:38", "url": "https://files.pythonhosted.org/packages/15/cf/7d7dda7348bd781901dff0881dc49ef5b402d66f9a4f5276381812081066/django-settings-export-1.0.6.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "58be52a916911b98271c1599f8ba7423", "sha256": "61b13bd1d2195ca64b1052d18d7eceacca1a4c2a3395a0f672226c00e7ecb5f9" }, "downloads": -1, "filename": "django-settings-export-1.1.0.tar.gz", "has_sig": false, "md5_digest": "58be52a916911b98271c1599f8ba7423", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4482, "upload_time": "2016-03-10T02:09:17", "url": "https://files.pythonhosted.org/packages/db/26/4f48c921002d6ca064754e51fa37bb3b8acc844e2073720e346ec57d0e9f/django-settings-export-1.1.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "2ba67d2cfdbbdbcd631ccc56ab3381e8", "sha256": "fceeae49fc597f654c1217415d8e049fc81c930b7154f5d8f28c432db738ff79" }, "downloads": -1, "filename": "django-settings-export-1.2.1.tar.gz", "has_sig": false, "md5_digest": "2ba67d2cfdbbdbcd631ccc56ab3381e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4951, "upload_time": "2016-11-06T11:18:58", "url": "https://files.pythonhosted.org/packages/d6/72/9848a2d631dad70d7ea582540f0619e1a7ecf31b3a117de9d9f2b6b28029/django-settings-export-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2ba67d2cfdbbdbcd631ccc56ab3381e8", "sha256": "fceeae49fc597f654c1217415d8e049fc81c930b7154f5d8f28c432db738ff79" }, "downloads": -1, "filename": "django-settings-export-1.2.1.tar.gz", "has_sig": false, "md5_digest": "2ba67d2cfdbbdbcd631ccc56ab3381e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4951, "upload_time": "2016-11-06T11:18:58", "url": "https://files.pythonhosted.org/packages/d6/72/9848a2d631dad70d7ea582540f0619e1a7ecf31b3a117de9d9f2b6b28029/django-settings-export-1.2.1.tar.gz" } ] }