{ "info": { "author": "Keryn Knight", "author_email": "python-package@kerynknight.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP" ], "description": "===================\r\ndjango-allowedsites\r\n===================\r\n\r\nDjango 1.6+ library for setting your ``ALLOWED_HOSTS`` based on the domains in ``django.contrib.sites``\r\n\r\n.. image:: https://travis-ci.org/kezabelle/django-allowedsites.svg?branch=master\r\n :target: https://travis-ci.org/kezabelle/django-allowedsites\r\n\r\nUsage is something like the following, in your ``settings.py`` or equivalent::\r\n\r\n from allowedsites import AllowedSites\r\n ALLOWED_HOSTS = AllowedSites(defaults=('mytestsite.com',))\r\n \r\nOr, if you want to use your cache backend::\r\n\r\n from allowedsites import CachedAllowedSites\r\n ALLOWED_HOSTS = CachedAllowedSites()\r\n \r\nA single key, ``allowedsites`` will be inserted containing an unsorted collection \r\nof all the domains that are in the ``django.contrib.sites``. For the sake of allowing\r\nmultiple processes to keep up to date with the ``Site`` values without hitting \r\nthe database, using a shared cache (ie: not ``LocMemCache``) is encouraged.\r\n\r\nThe ``CachedAllowedSites`` also provides an ``update_cache`` class method which\r\nmay be used as a signal listener::\r\n\r\n from django.db.models.signals import post_save\r\n from django.contrib.sites.models import Site\r\n post_save.connect(CachedAllowedSites.update_cache, sender=Site,\r\n dispatch_uid='update_allowedsites')\r\n \r\nYou can modify the the defaults::\r\n\r\n from allowedsites import AllowedSites\r\n ALLOWED_HOSTS = AllowedSites(defaults=('mytestsite.com',))\r\n ALLOWED_HOSTS += AllowedSites(defaults=('anothersite.net',))\r\n ALLOWED_HOSTS -= AllowedSites(defaults=('mytestsite.com',))\r\n # ultimately, only anothersite.net is in the defaults\r\n\r\nOther uses?\r\n-----------\r\n\r\nIt *may* work with `django-csp`_ (Content Security Policy headers), \r\n`django-dcors`_ (Cross-Origin Resource Sharing headers) and others. I don't know.\r\n\r\n.. _django-csp: https://github.com/mozilla/django-csp\r\n.. _django-dcors: https://github.com/prasanthn/django-dcors\r\n\r\n\r\n----\r\n\r\nCopyright (c) 2014, Keryn Knight\r\nAll rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without\r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n1. Redistributions of source code must retain the above copyright notice, this\r\n list of conditions and the following disclaimer.\r\n2. Redistributions in binary form must reproduce the above copyright notice,\r\n this list of conditions and the following disclaimer in the documentation\r\n and/or other materials provided with the distribution.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\r\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\nThe views and conclusions contained in the software and documentation are those\r\nof the authors and should not be interpreted as representing official policies,\r\neither expressed or implied, of the FreeBSD Project.\r\n\r\nThis license applies to version 0.1.0 of django-allowedsites.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kezabelle/django-allowedsites", "keywords": "", "license": "BSD License", "maintainer": "Emmanuelle Delescolle", "maintainer_email": "emma@levit.be", "name": "django-allowedsites", "package_url": "https://pypi.org/project/django-allowedsites/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-allowedsites/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kezabelle/django-allowedsites" }, "release_url": "https://pypi.org/project/django-allowedsites/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "dynamic ALLOWED_HOSTS", "version": "0.1.0" }, "last_serial": 1508966, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "894e94c6f39685c399f2df0e4ae2d720", "sha256": "c28596b802e65605194c1f3222f873b44efc5d84ca3532d3c266488691b24b4e" }, "downloads": -1, "filename": "django-allowedsites-0.1.0.tar.gz", "has_sig": false, "md5_digest": "894e94c6f39685c399f2df0e4ae2d720", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4480, "upload_time": "2015-04-17T08:09:19", "url": "https://files.pythonhosted.org/packages/b3/8c/96c98a83493af6a3334eb58c750f468ce7b255519f7e7d225190e2776be1/django-allowedsites-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "894e94c6f39685c399f2df0e4ae2d720", "sha256": "c28596b802e65605194c1f3222f873b44efc5d84ca3532d3c266488691b24b4e" }, "downloads": -1, "filename": "django-allowedsites-0.1.0.tar.gz", "has_sig": false, "md5_digest": "894e94c6f39685c399f2df0e4ae2d720", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4480, "upload_time": "2015-04-17T08:09:19", "url": "https://files.pythonhosted.org/packages/b3/8c/96c98a83493af6a3334eb58c750f468ce7b255519f7e7d225190e2776be1/django-allowedsites-0.1.0.tar.gz" } ] }