{ "info": { "author": "Abhilash Raj", "author_email": "maxking@asynchronous.in", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3" ], "description": "====================\nDjango Settings Toml\n====================\n\nThis project is used to configure `Django `_ projects using a `Toml `_ configuration file. This project chooses Toml over other configuration language becuase of it's simplicity and small specification. It is easier to understand and looks very much like INI-style config. We couldn't use INI-style because it is difficult to repsent data structures like dictionaries and lists, and there is no support for nesting.\n\nChangelog\n=========\n0.0.4\n-----\n- Add support for Substitution in maps and lists.\n- Fix loading settings where values are non-string which caused TypeError in v0.0.3.\n\n0.0.3\n-----\n- Fix packaging for the new release.\n\n0.0.2\n------\n- Add support for variable substitution using ``${VAR}`` syntax in values.\n\n\nUsage\n=====\n\nTo use this in your Django project, Add the following to your ``settings.py`` file::\n\n # settings.py\n from django_settings_toml import load_settings\n\n load_settings(__name__, ['/etc/project.toml', '~/.project.toml'])\n\n\nThen, you can run your django project like this::\n\n $ DJANGO_SETTINGS_MODULE=project.settings django-admin runserver\n\n\nVariable Substitution\n---------------------\n\nValues can refer to other keys defined in the same file using ``${VAR}``\nsyntax. For example::\n\n\n # /etc/project.toml\n\n HOSTNAME = 'domain.local'\n\n EMAIL1 = 'aperson@${HOSTNAME}'\n\n EMAIL2 = 'bperson@${HOSTNAME}'\n\n\nIn the above example, the value of ``EMAIL1 = 'aperson@domain.local`` and\nsimilar for ``EMAIL2``.\n\nIf they variables that are being referred to aren't defined, the template is\nleft as-is and doesn't raise any errors. For example, in the above example, if\n``HOSTNAME`` wasn't defined, the value will be ``EMAIL1 =\n'aperson@${HOSTNAME}``.\n\n\nExample Settings\n================\n::\n\n # /etc/project.toml\n # SECURITY WARNING: keep the secret key used in production secret!\n SECRET_KEY = 'change-this-on-your-production-server'\n\n # SECURITY WARNING: don't run with debug turned on in production!\n DEBUG = false\n\n ADMINS = [\n ['Mailman Suite Admin', 'root@localhost'],\n ]\n\n # Application definition\n INSTALLED_APPS = [\n 'django.contrib.admin',\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n 'rest_framework',\n 'django_q',\n 'allauth',\n ]\n\n MIDDLEWARE = [\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.middleware.locale.LocaleMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.middleware.security.SecurityMiddleware',\n ]\n\n ROOT_URLCONF = 'project.urls'\n\n WSGI_APPLICATION = 'project.wsgi.application'\n\n HOSTNAME = 'project.local'\n\n EMAIL_NAME = 'project1@${HOSTNAME}'\n\n [DATABASES.default]\n ENGINE = 'django.db.backends.sqlite3'\n NAME = 'mailmansuite.db'\n\n [LOGGING]\n version = 1\n disable_existing_loggers = false\n\n [LOGGING.filters.require_debug_false]\n '()' = 'django.utils.log.RequireDebugFalse'\n\n [LOGGING.handlers.mail_admins]\n level = 'ERROR'\n filters = ['require_debug_false']\n class = 'django.utils.log.AdminEmailHandler'\n\n [LOGGING.handlers.file]\n level = 'INFO'\n class = 'logging.handlers.WatchedFileHandler'\n filename = 'logs/mailmansuite.log'\n formatter = 'verbose'\n\n [LOGGING.loggers.\"django.request\"]\n handlers = ['mail_admins', 'file']\n level = 'ERROR'\n propagate = true\n\n [LOGGING.formatters.verbose]\n format = '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s'\n\n\nGotchas\n=======\n\n- Please make sure that you have writtena valid Toml, you can use\n `TOML Validator `_ or\n `tomlcheck `_ tools to\n validate the toml file.\n\n- Please make sure that all smiple ``KEY = value`` pairs are in the\n root namespace (above any ``[section]``) so that they don't get\n swallowed under one of the maps or arrays. Previously, we have\n seen ``ImproperlyConfiguredError`` for missing keys that were\n actually defined in the toml file.\n\nLICENSE\n=======\n\nThe contents of this project is licensed under Apache License 2.0. Please see\nthe LICENSE file for a complete copy of license text.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "django-settings-toml", "package_url": "https://pypi.org/project/django-settings-toml/", "platform": "", "project_url": "https://pypi.org/project/django-settings-toml/", "project_urls": null, "release_url": "https://pypi.org/project/django-settings-toml/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Django settings using TOML configuration files.", "version": "0.0.4" }, "last_serial": 4977484, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "62bd18dd7f861ef4b6ff0352a125a01a", "sha256": "2dfc3bf3f026996a1456a9172202cfdff91db11ad072f349b52b07a851739355" }, "downloads": -1, "filename": "django-settings-toml-0.0.1.tar.gz", "has_sig": true, "md5_digest": "62bd18dd7f861ef4b6ff0352a125a01a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2487, "upload_time": "2019-03-04T08:30:16", "url": "https://files.pythonhosted.org/packages/dd/5a/bc8c4684eefe0312674a7f4038d0d487766114b4f09f731d2ec44e51a8c8/django-settings-toml-0.0.1.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "d5664d7ba45c8fb8d2dcb96adcf64632", "sha256": "c27cf5bb989b23199363d25be1658331a908dc5a45eb45b2f1aa5f44dd6ce381" }, "downloads": -1, "filename": "django-settings-toml-0.0.3.tar.gz", "has_sig": true, "md5_digest": "d5664d7ba45c8fb8d2dcb96adcf64632", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8693, "upload_time": "2019-03-24T00:33:27", "url": "https://files.pythonhosted.org/packages/a2/57/0f8a993df72f6532ccf56b7d6e535a2c2454ff732ea4321a60c030f4d294/django-settings-toml-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "fe6b3010b12f5b764b6ec47fcc928adc", "sha256": "8ef1bda50e9c2733560b4a87d4a35e1f1aea8d42bef328ba9988b64da2749cf7" }, "downloads": -1, "filename": "django-settings-toml-0.0.4.tar.gz", "has_sig": true, "md5_digest": "fe6b3010b12f5b764b6ec47fcc928adc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9286, "upload_time": "2019-03-24T08:02:27", "url": "https://files.pythonhosted.org/packages/2b/43/d7f3e1995e467f68560a86a059345f2d2a84bfc2358e5056c4c27f11ced4/django-settings-toml-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fe6b3010b12f5b764b6ec47fcc928adc", "sha256": "8ef1bda50e9c2733560b4a87d4a35e1f1aea8d42bef328ba9988b64da2749cf7" }, "downloads": -1, "filename": "django-settings-toml-0.0.4.tar.gz", "has_sig": true, "md5_digest": "fe6b3010b12f5b764b6ec47fcc928adc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9286, "upload_time": "2019-03-24T08:02:27", "url": "https://files.pythonhosted.org/packages/2b/43/d7f3e1995e467f68560a86a059345f2d2a84bfc2358e5056c4c27f11ced4/django-settings-toml-0.0.4.tar.gz" } ] }