{ "info": { "author": "Adam Johnson", "author_email": "me@adamj.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only" ], "description": "django-settings-file\n====================\n\nLet Django use settings from an arbitrary Python file instead of an importable module.\n\nAs per `James Pic's idea posted on the django-developers mailing list\n`_.\n\nRequirements\n------------\n\nPython 3.4+ and Django 1.11-2.2 are supported.\n\nUsage\n-----\n\n1. Install with ``pip install django-settings-file``.\n\n2. Edit your ``manage.py`` and ``wsgi.py`` to swap out Django's default logic for setting ``DJANGO_SETTINGS_MODULE`` to\n instead do:\n\n .. code-block:: python\n\n import django_settings_file\n django_settings_file.setup()\n\n3. Add ``os.environ.setdefault('DJANGO_SETTINGS_FILE', '/path/to/default.py')`` before the ``setup()`` call, unless you\n can be sure ``DJANGO_SETTINGS_FILE`` will always be defined in your environment. You might need to figure out the\n path relative to your ``manage.py`` with some ``os.path`` manipulation.\n\n4. Run it! If ``DJANGO_SETTINGS_MODULE`` is defined, it will raise a ``DjangoSettingsFileError`` with a message about\n how only ``DJANGO_SETTINGS_FILE`` is allowed now. If ``DJANGO_SETTINGS_FILE`` is not defined, it will also fail with\n a ``DjangoSettingsFileError`` with a message about defining it. Otherwise Django should start with the settings!\n\nHow it works\n------------\n\n``django-settings-file`` imports the contents of the specified file using the import machinery available on your Python\nversion (different logic for 2 and 3) and copies it contents into its own module, which Django sees as the settings\nfile defined via the traditional ``DJANGO_SETTINGS_MODULE``. Nothing about Django is really touched, it's just a\nhacky module.\n\nCaveats\n-------\n\n* If the Python file defined by ``DJANGO_SETTINGS_FILE`` tries to do any imports, the directory the file is in will not\n be on ``PYTHONPATH``, so the author of the settings file might get some surprises.\n* Additionally, you might experience other problems from loading a file whilst it's not on ``PYTHONPATH``.\n* If you want your settings file to extend another one, it will probably find it easiest to ``import`` the base one\n from a location on ``PYTHONPATH``, otherwise it too will have to do use the same import 'hacks' to load the default\n settings.\n* File paths are not portable between operating systems, so you may need logic to support both Unix and Windows at\n once.\n* File paths are not portable between ``.py`` and ``.pyc`` files. In most cases this means a ``.pyc`` file will not be\n used for settings since it can't be guaranteed to be there, slightly slowing down import time.\n* ``DJANGO_SETTINGS_MODULE`` and ``DJANGO_SETTINGS_FILE`` can't both be used by the same project, since the module is\n required for the file-based logic. You might be able to allow them both with extra logic, pull requests accepted.\n* ``\u00af\\_(\u30c4)_/\u00af`` - this is kind of unknown territory, this library has not been tested in any real project, just with\n the example project in the test folder.\n\n\nHistory\n=======\n\nPending release\n---------------\n\n.. Insert new release notes below this line\n\n2.0.1 (2019-04-28)\n------------------\n\n* Tested with Django 2.2. No changes were required for compatibility.\n\n2.0.0 (2019-02-02)\n------------------\n\n* Drop Python 2 support, only Python 3.4+ is supported now.\n* Drop Django 1.8, 1.9, and 1.10 support. Only Django 1.11+ is supported now.\n\n1.0.0 (2017-04-14)\n------------------\n\n* First version, supporting ``DJANGO_SETTINGS_FILE`` instead of\n ``DJANGO_SETTINGS_MODULE``\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/adamchainz/django-settings-file", "keywords": "Django", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "django-settings-file", "package_url": "https://pypi.org/project/django-settings-file/", "platform": "", "project_url": "https://pypi.org/project/django-settings-file/", "project_urls": { "Homepage": "https://github.com/adamchainz/django-settings-file" }, "release_url": "https://pypi.org/project/django-settings-file/2.0.1/", "requires_dist": [ "Django (>=1.11)" ], "requires_python": ">=3.4", "summary": "Let Django use settings from an arbitrary Python file instead of an importable module", "version": "2.0.1" }, "last_serial": 5200409, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "7c3fe575f6b1ad52c024659772abe3b6", "sha256": "fe041627c27372c602cfba1f782704bc110fe8ca29efff1479b0c1a57dfd9bfc" }, "downloads": -1, "filename": "django_settings_file-1.0.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "7c3fe575f6b1ad52c024659772abe3b6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6536, "upload_time": "2017-04-13T23:17:02", "url": "https://files.pythonhosted.org/packages/ff/5f/69581f263a95211aa845f9827985ce1a640b4d006f23cabb39a1099dcb27/django_settings_file-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "857196824ff63dd6a17f1ca4724dc926", "sha256": "fac5c183b52de54858af6260490f03eebe7442cfa02c635a52a898853bc379de" }, "downloads": -1, "filename": "django-settings-file-1.0.0.tar.gz", "has_sig": true, "md5_digest": "857196824ff63dd6a17f1ca4724dc926", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5824, "upload_time": "2017-04-13T23:16:59", "url": "https://files.pythonhosted.org/packages/c2/ba/1b53339c0cb4b3b835c6c6e5e5582b941672e527ce898def6b02188b44dd/django-settings-file-1.0.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "95e2f9ad5bf1a6f2e21a24d7912c4042", "sha256": "f15346bc7fec6d4de8e63345763ec8793da292a61b9c601d613185248a18faab" }, "downloads": -1, "filename": "django_settings_file-2.0.0-py3-none-any.whl", "has_sig": true, "md5_digest": "95e2f9ad5bf1a6f2e21a24d7912c4042", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4416, "upload_time": "2019-02-04T20:31:54", "url": "https://files.pythonhosted.org/packages/d5/44/f33b803dd116f55812af8b4ad64f7598d684c4cd2ec3d099f71d3c6e69ee/django_settings_file-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e2b85420c1bccea98ab0976e7f593f40", "sha256": "2c51be12c8f593367cd75a99afeb801dc8151ac6249c13182ef8bc470535b4ee" }, "downloads": -1, "filename": "django-settings-file-2.0.0.tar.gz", "has_sig": true, "md5_digest": "e2b85420c1bccea98ab0976e7f593f40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5798, "upload_time": "2019-02-02T09:14:46", "url": "https://files.pythonhosted.org/packages/5e/74/04e30b7fad29925ee1c50e9eff09c90a2dcd55e46445f6541f8aa392fbe5/django-settings-file-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "fdd829564ac67fe746af9923f5df7f0a", "sha256": "40475ab5e9472bdf00a9e38044e26311b11905df1e9b836b6cbdf4398fc34a4f" }, "downloads": -1, "filename": "django_settings_file-2.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "fdd829564ac67fe746af9923f5df7f0a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 4466, "upload_time": "2019-04-28T19:01:28", "url": "https://files.pythonhosted.org/packages/66/71/82f2a4c7331dbe487230b2af5c5a389820b5a3b54f9a5c9261d65fe77e41/django_settings_file-2.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94c7993c627448cf60be093680066997", "sha256": "0af626655df914fb5030ef20767e79efc418c4ef0d070881a450ad2183cc0d9f" }, "downloads": -1, "filename": "django-settings-file-2.0.1.tar.gz", "has_sig": true, "md5_digest": "94c7993c627448cf60be093680066997", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 5865, "upload_time": "2019-04-28T19:01:32", "url": "https://files.pythonhosted.org/packages/ed/ae/38d16518e4f15a0b7cbbe67f4cb77c02a0d5ebf42668ff3501af1cde7139/django-settings-file-2.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fdd829564ac67fe746af9923f5df7f0a", "sha256": "40475ab5e9472bdf00a9e38044e26311b11905df1e9b836b6cbdf4398fc34a4f" }, "downloads": -1, "filename": "django_settings_file-2.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "fdd829564ac67fe746af9923f5df7f0a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 4466, "upload_time": "2019-04-28T19:01:28", "url": "https://files.pythonhosted.org/packages/66/71/82f2a4c7331dbe487230b2af5c5a389820b5a3b54f9a5c9261d65fe77e41/django_settings_file-2.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94c7993c627448cf60be093680066997", "sha256": "0af626655df914fb5030ef20767e79efc418c4ef0d070881a450ad2183cc0d9f" }, "downloads": -1, "filename": "django-settings-file-2.0.1.tar.gz", "has_sig": true, "md5_digest": "94c7993c627448cf60be093680066997", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 5865, "upload_time": "2019-04-28T19:01:32", "url": "https://files.pythonhosted.org/packages/ed/ae/38d16518e4f15a0b7cbbe67f4cb77c02a0d5ebf42668ff3501af1cde7139/django-settings-file-2.0.1.tar.gz" } ] }