{ "info": { "author": "Micha\u0142 Szostak", "author_email": "szostak.m.f@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=============\nDjango-Config\n=============\n\n(Works with django>=1.9, and possibly lower versions, but it wasn't tested, use at your own discretion)\n\nThis is a simple library which was build out of personal necessity.\n\nAs good as django is as a framework, it does not provide any 'out of the box' plugin for\nextending settings.py with end user config files. Just to make sure - I do not treat python files as \nsettings - giving end user ability to run arbitrary code in the application context is a great\nway to bring disaster to whole system.\n\nOn the other hand settings.py contains a lot of code and settings which are not really up\nfor configuration (middleware, installed apps, this is clearly for the developer).\n\nFor a couple of smaller and larger projects now I had to manually write some code which was\nresponsible for reading external config files (usually `.ini` style) and inserting them into\nsettings.py, in some cases also some code for generating stub configs was required.\n\nSo at some point I decided - \"Why shouldn't I make this into a reusable app?\" - and this is how\nthis library was made.\n\n\nThe main purpose of this library is to let you specify end user config in a declarative way: ::\n\n config = django_configure.define({\n 'Common': {\n 'secret': django_configure.type.String('Secret for the application', default=generate_secret()),\n 'static_root': django_configure.type.Path('Static root path (static files will be copied here)',\n default='/var/lib/myapp/static/'),\n 'static_url': django_configure.type.Path('Url to static files', default='/static/'),\n 'media_root': django_configure.type.Path('Media root path (media files will be stored here)',\n default='/var/lib/myapp/media/'),\n 'media_url': django_configure.type.Path('Url to media files', '/media/'),\n 'debug': django_configure.type.Boolean(help='if true debug mode will be enabled for the application, do not switch this in production', default=False)\n },\n 'Database': {\n 'url': django_configure.type.Database('Url to access database (including credentials)',\n default='sqlite:////var/lib/myapp/myapp.sqlite')\n }\n }, env_prefix='MYAPP')\n\n\nAfterwards you can assign values to settings variables as follows: ::\n\n SECRET_KEY=config.get('Common.secret')\n\nAs the fields in the config file are type aware they do a good job at converting string to booleans, or numbers::\n\n DEBUG=config.get('Common.debug')\n\n\nFor convenience sake function for generating default config: ::\n\n config = django_configure.default('myapp', env_prefix='MYAPP')\n\n\nAbove code will generate config object with following fields (secret will be auto generated): ::\n\n {\n 'Common': {\n 'secret': django_configure.type.String('Secret for the application', default=generate_secret()),\n 'static_root': django_configure.type.Path('Static root path (static files will be copied here)',\n default='/var/lib/' + app_name + '/static/'),\n 'static_url': django_configure.type.Path('Url to static files', default='/static/'),\n 'media_root': django_configure.type.Path('Media root path (media files will be stored here)',\n default='/var/lib/' + app_name + '/media/'),\n 'media_url': django_configure.type.Path('Url to media files', '/media/'),\n 'debug': django_configure.type.Boolean(help='if true debug mode will be enabled for the application, do not switch this in production', default=False)\n },\n 'Database': {\n 'url': django_configure.type.Database('Url to access database (including credentials)',\n default='sqlite:////var/lib/'+app_name+'/'+app_name+'.sqlite')\n }\n }\n\n\nYou can redefine / append parts of this via `config.append(additional_field)`: ::\n\n config = django_configure.default('myapp', env_prefix='MYAPP')\n config.append({'Common': {'media_root': '/my/secret/storage'}})\n\n\nConfig specified as follows can be read from environmental variable (env_prefix+CONFIG, in the case\nof above code it will be MYAPP_CONFIG). Config path can also be specified in config definition via\n`default_path` variable, but it's not recomended, as it hardcodes path into settings.py which is \npreciusly what we want to avoid.\n\nAfter defining config in `settings.py` there is a possibility to generate template config and wsgi file\nby running `manage.py` command: ::\n\n python manage.py createconfig \n\n\nPath to the config file will be hardcoded into wsgi file, so be mindful (You can always manually edit\nwsgi file later)\n\n\nChangelog\n---------\n\n* **Version 0.3.0**: Added support for python 3+, added `hostname` to config defaults", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "configuration,django", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-configure", "package_url": "https://pypi.org/project/django-configure/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-configure/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-configure/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "Utility for defining external django configs (for end user)", "version": "0.3.0" }, "last_serial": 2832949, "releases": { "0.2.4": [ { "comment_text": "", "digests": { "md5": "b42d2546306439dc290e5f3f08d0b4e3", "sha256": "de11b27b692215343148d8ede613ede5eaa5617f9832fe634d61883beff59161" }, "downloads": -1, "filename": "django-configure-0.2.4.tar.gz", "has_sig": false, "md5_digest": "b42d2546306439dc290e5f3f08d0b4e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9712, "upload_time": "2017-01-08T16:31:30", "url": "https://files.pythonhosted.org/packages/0b/51/72c5aed262f6f2fb0a1f56d1bb29cb5644de8b14597fc07c804ff6fa1b58/django-configure-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "7f29213ced71b4efc55f6a5e3c697aa4", "sha256": "c15f894b6a8d5ca1d805b6951c70bf8f5c12ed7a572f499a2384fae60550554e" }, "downloads": -1, "filename": "django-configure-0.2.5.tar.gz", "has_sig": false, "md5_digest": "7f29213ced71b4efc55f6a5e3c697aa4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9717, "upload_time": "2017-02-15T01:12:59", "url": "https://files.pythonhosted.org/packages/f8/5d/ba00179eceedda969fbffe047678d37127f9cc40bfafd7e4f1f1854fe46e/django-configure-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "cb9a3618cd1853249218aa93e19bc43b", "sha256": "b931f6fbb8197cdbb2238ecf43add074c0ecc93097836e0df02d2dc672505048" }, "downloads": -1, "filename": "django-configure-0.2.6.tar.gz", "has_sig": false, "md5_digest": "cb9a3618cd1853249218aa93e19bc43b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9717, "upload_time": "2017-02-15T01:18:14", "url": "https://files.pythonhosted.org/packages/3b/46/07ebc81bd5da94641524779dd979c7ce1491a7db797ddf3ac03b25426665/django-configure-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "abc99686e8ca3a1c347ea6366fe82c99", "sha256": "a631882172abb8caaf9b7f0214f196f9a76cac033e5ce6ea575766e685493a56" }, "downloads": -1, "filename": "django-configure-0.2.7.tar.gz", "has_sig": false, "md5_digest": "abc99686e8ca3a1c347ea6366fe82c99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9721, "upload_time": "2017-02-15T01:33:58", "url": "https://files.pythonhosted.org/packages/21/b4/4c8887a4ae52b2b0145791b2da95d4e13e422b755fe8086f7d24bc1d79c7/django-configure-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "4894c58f7106490a8965c5ce1575052b", "sha256": "0ae382bb70c87d0366033f48c91005dad9773f98f212867570a9e6040ec63708" }, "downloads": -1, "filename": "django-configure-0.2.8.tar.gz", "has_sig": false, "md5_digest": "4894c58f7106490a8965c5ce1575052b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9719, "upload_time": "2017-02-15T02:42:49", "url": "https://files.pythonhosted.org/packages/4c/0b/1bf1971d6450573a1f87eee69f7e17049a782dde299e187d50ea0b154259/django-configure-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "ae6bfe30e653a4755e2e4f308dbdf59d", "sha256": "7659fcc880cb334178d81df02defbd87a54731bcc10666d8ab2142f1dfad7807" }, "downloads": -1, "filename": "django-configure-0.2.9.tar.gz", "has_sig": false, "md5_digest": "ae6bfe30e653a4755e2e4f308dbdf59d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9722, "upload_time": "2017-02-15T02:59:44", "url": "https://files.pythonhosted.org/packages/e3/84/7bc6e8635995c9e89ba691c317a1a03c4db451b7ffcf4dd72f4a362b475d/django-configure-0.2.9.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "93bb76410ee5ed3c405a38635b705038", "sha256": "a678cb08a35cbadeb87dccb10323876e19f4c445bc817c457a624985a05ee536" }, "downloads": -1, "filename": "django-configure-0.3.0.tar.gz", "has_sig": false, "md5_digest": "93bb76410ee5ed3c405a38635b705038", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10968, "upload_time": "2017-04-26T21:08:42", "url": "https://files.pythonhosted.org/packages/c7/33/8b65d96a341f2bfdfeb9b38e812df51d084b40caf67d8aba473f95afd926/django-configure-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93bb76410ee5ed3c405a38635b705038", "sha256": "a678cb08a35cbadeb87dccb10323876e19f4c445bc817c457a624985a05ee536" }, "downloads": -1, "filename": "django-configure-0.3.0.tar.gz", "has_sig": false, "md5_digest": "93bb76410ee5ed3c405a38635b705038", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10968, "upload_time": "2017-04-26T21:08:42", "url": "https://files.pythonhosted.org/packages/c7/33/8b65d96a341f2bfdfeb9b38e812df51d084b40caf67d8aba473f95afd926/django-configure-0.3.0.tar.gz" } ] }