{ "info": { "author": "Shakurov Vadim Vladimirovich", "author_email": "apelsinsd@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "Site settings\n=============\n\nA sample settings for your any project.\nThe packages allows to keep project settings in a simple python module.\nThe module path can be specified in environment variables or specified in the method ``configure``.\n\nIn addition, environment variables can contain any variables that will not be overwritten by the module.\nAll variables must begin with the base name of the settings and in the upper case.\n\nA project can have multiple settings modules:\n\n* base - base settings for the project;\n* extra - extra variables, for example dev or staging;\n* global - global variables, like variables by default.\n\nAll variables in all modules should be in upper case.\n\nExtra variables declared in the base settings module as ``settings.EXTRA_VAR = \"VAR_VALUE\"`` and\nuse like so ``VAR = settings.EXTRA_VAR.split('_') + ['example']``.\nIn the extra settings module declared extra value of variables as ``settings.EXTRA_VAR = \"EXTRA_VAR_VALUE\"``\nand last line import base settings module ``from my_project.conf.base import *``.\nIn result ``assert VAR == ['EXTRA', 'VAR', 'VALUE', 'example']``.\n\nExample\n-------\n\n./start.py::\n\n import os\n\n if __name__ == '__main__':\n from my_project import main\n\n os.environ.setdefault(\"BASE_SETTINGS_NAME\", \"MY_PROJECT\")\n os.environ.setdefault(\"MY_PROJECT_SETTINGS_MODULE\", \"my_project.conf.extra\")\n os.environ.setdefault(\"MY_PROJECT_GLOBAL_SETTINGS_MODULE\", \"my_project.conf.global\")\n\n os.environ[\"MY_PROJECT_VAR_2\"] = \"ENV_VAR_2_VALUE\"\n\n main.run()\n\n./my_project/main.py::\n\n from my_project.conf import settings\n\n\n def run():\n settings.configure()\n\n # your code\n from my_project import code\n\n./my_project/conf/__init__.py::\n\n from project_settings import Settings, AppsSettings\n\n settings = Settings()\n apps_settings = AppsSettings()\n\n./my_project/conf/extra.py::\n\n from my_project.conf import settings\n\n settings.EXTRA_VAR = \"EXTRA_VAR_VALUE\"\n\n from my_project.conf.base import *\n\n./my_project/conf/base.py::\n\n from my_project.conf import settings\n\n VAR_1 = \"VAR_1_VALUE\"\n VAR_2 = \"VAR_2_VALUE\"\n settings.EXTRA_VAR = \"BASE_EXTRA_VAR_VALUE\"\n VAR_5 = settings.VAR_4 + \"_VAR_5_VALUE\"\n\n./my_project/conf/global.py::\n\n VAR_1 = \"GLOBAL_VAR_1_VALUE\"\n VAR_2 = \"GLOBAL_VAR_2_VALUE\"\n VAR_3 = \"GLOBAL_VAR_3_VALUE\"\n VAR_4 = \"GLOBAL_VAR_4_VALUE\"\n\n./my_project/code.py::\n\n from my_project.conf import settings\n\n assert settings.VAR_1 == \"VAR_1_VALUE\"\n assert settings.VAR_2 == \"ENV_VAR_2_VALUE\"\n assert settings.VAR_3 == \"GLOBAL_VAR_3_VALUE\"\n assert settings.VAR_4 == \"EXTRA_VAR_VALUE\"\n assert settings.VAR_5 == \"EXTRA_VAR_VALUE_VAR_5_VALUE\"\n\nAfter running ``python start.py`` all settings will be generated after executing ``settings.configure()``.\nAfter configuration, you can overwrite the values of variables, for example: `settings.VAR_1 = \"NEW_VALUE_VAR_1\"`.\n\nApps settings\n-------------\nFor use in the settings, you must specify a variable with list of applications\n`INSTALLED_APPS = ['my_project.apps.app']` and initialize `apps_settings = AppsSettings()`.\nNext, you must add the package `my_project.apps.app` module `settings` on the inside.\nThe module may contain application variables declared in upper case.\n\n./my_project.apps.app.settings.py::\n\n from project_settings import AppSettings\n\n\n VAR1 = 'app_var1'\n VAR2 = 'app_var2'\n\n\n class AppSettings(AppSettings):\n name = 'app'\n\n def ready(self):\n from my_project.conf import settings\n\n settings.READY_VAR = 'APP_READY_VAR'\n\n\nApplication settings will be available as `apps_settings.app.VAR1`.\nApplication settings variables can also be declared using the environment variables,\nif it starts with the application name at the upper case, for example ``export APP_ENV_VAR=example``.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/NewVadim/project-settings.git", "keywords": "", "license": "GNU General Public License v3 (GPLv3)", "maintainer": "", "maintainer_email": "", "name": "project-settings", "package_url": "https://pypi.org/project/project-settings/", "platform": "", "project_url": "https://pypi.org/project/project-settings/", "project_urls": { "Homepage": "https://github.com/NewVadim/project-settings.git" }, "release_url": "https://pypi.org/project/project-settings/1.2.0/", "requires_dist": null, "requires_python": "", "summary": "Project settings in python module.", "version": "1.2.0" }, "last_serial": 4168322, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "16e476069d41d170f409c9c3986bb7f6", "sha256": "241a66a8079460f10120a83804b6aa9f69543cb72da3a1c40fb28d86b4537a68" }, "downloads": -1, "filename": "project_settings-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "16e476069d41d170f409c9c3986bb7f6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6555, "upload_time": "2017-10-04T20:35:00", "url": "https://files.pythonhosted.org/packages/51/2c/d9fa7199767dae0535eb0434c58164d0b59a066a27c01ab87b9a23450df8/project_settings-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97bea6ab42d9de6a69d8b6fa5b9d2ca1", "sha256": "0fe45679315e1ad0134e7717ee0300ecc88ab4f1006c86875bbc8c40b7626c6f" }, "downloads": -1, "filename": "project-settings-1.0.0.tar.gz", "has_sig": false, "md5_digest": "97bea6ab42d9de6a69d8b6fa5b9d2ca1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4402, "upload_time": "2017-10-04T20:35:02", "url": "https://files.pythonhosted.org/packages/d0/b7/6aacd42f67524a7ca85ec6a608c117a15f87fd69fc31a0e0eb687fc8d65f/project-settings-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "39761ff19e53804acf99efc8f3b36bc1", "sha256": "a6fbde322e19f5b53c056348db6800d6cd5589d29f1178fe850e1b5e62ed0fa5" }, "downloads": -1, "filename": "project_settings-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "39761ff19e53804acf99efc8f3b36bc1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6554, "upload_time": "2017-10-05T06:41:44", "url": "https://files.pythonhosted.org/packages/90/08/fc4be2f8b6ab0ffbc7d196768b490cd7577b33cd8ae827be80287ab918ee/project_settings-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "af9a9fb59d5dfb7b860d4f522b4b68f5", "sha256": "2703c3d35232efcd1d2ffbe982d6f6e4a9281898d840fb70fdb330da030e641d" }, "downloads": -1, "filename": "project-settings-1.0.1.tar.gz", "has_sig": false, "md5_digest": "af9a9fb59d5dfb7b860d4f522b4b68f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4460, "upload_time": "2017-10-05T06:42:33", "url": "https://files.pythonhosted.org/packages/82/ef/be8ed49fd7afc52a0aee0c4ab30b2e870d218f4e8174388a2acc513f8dd7/project-settings-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "94598487bd49656c6dd4da26c86bf3c2", "sha256": "945cd95ed3de76fdfb453280e7751e463024110e2884de36877579c89eb87d79" }, "downloads": -1, "filename": "project_settings-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "94598487bd49656c6dd4da26c86bf3c2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6554, "upload_time": "2018-02-15T10:38:50", "url": "https://files.pythonhosted.org/packages/5c/71/a3dbdae78de61d0959503f891ddb691e78c6c467f6b19ca75d46b16f51e7/project_settings-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1274b73375b6909ff80b7eac246a5c88", "sha256": "eb13f26efbf91f5c951bcb30ea6eed4893e719c90d7f87535c7b95c6b56a5d4f" }, "downloads": -1, "filename": "project-settings-1.1.0.tar.gz", "has_sig": false, "md5_digest": "1274b73375b6909ff80b7eac246a5c88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4463, "upload_time": "2018-02-15T10:39:00", "url": "https://files.pythonhosted.org/packages/d0/d5/c37fc971c5ead95103017bc554931ae51aeae049b56c0bb1c86e8f897dd9/project-settings-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "698c7f2a3fdb00d24fc6a5918eaf9343", "sha256": "b27a032921ecc0ff5e66449e885a3397ecae4184cb2fc423804adf66bf87cf19" }, "downloads": -1, "filename": "project_settings-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "698c7f2a3fdb00d24fc6a5918eaf9343", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6671, "upload_time": "2018-08-14T08:53:56", "url": "https://files.pythonhosted.org/packages/34/05/f12421573cd20c9301c238489c503068bc8a3cc6527fc7a144b96534bb48/project_settings-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ea12f9ff706edace6e56964cb017e6e", "sha256": "a6b0c81486fc6680dad12d87480322d24bf0f3081e6995a27c3cf09a3b53b0df" }, "downloads": -1, "filename": "project-settings-1.2.0.tar.gz", "has_sig": false, "md5_digest": "1ea12f9ff706edace6e56964cb017e6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4583, "upload_time": "2018-08-14T08:54:45", "url": "https://files.pythonhosted.org/packages/55/55/ff692f42815204ad5eb45ba8509a0281e7e29303fb4178c888d1503aa527/project-settings-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "698c7f2a3fdb00d24fc6a5918eaf9343", "sha256": "b27a032921ecc0ff5e66449e885a3397ecae4184cb2fc423804adf66bf87cf19" }, "downloads": -1, "filename": "project_settings-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "698c7f2a3fdb00d24fc6a5918eaf9343", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6671, "upload_time": "2018-08-14T08:53:56", "url": "https://files.pythonhosted.org/packages/34/05/f12421573cd20c9301c238489c503068bc8a3cc6527fc7a144b96534bb48/project_settings-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ea12f9ff706edace6e56964cb017e6e", "sha256": "a6b0c81486fc6680dad12d87480322d24bf0f3081e6995a27c3cf09a3b53b0df" }, "downloads": -1, "filename": "project-settings-1.2.0.tar.gz", "has_sig": false, "md5_digest": "1ea12f9ff706edace6e56964cb017e6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4583, "upload_time": "2018-08-14T08:54:45", "url": "https://files.pythonhosted.org/packages/55/55/ff692f42815204ad5eb45ba8509a0281e7e29303fb4178c888d1503aa527/project-settings-1.2.0.tar.gz" } ] }