{ "info": { "author": "Randall Degges", "author_email": "r@rdegges.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: Public Domain", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-sslify\n=============\n\nDo you want to force HTTPs across your Django site? You're in the right place!\n\n.. image:: https://img.shields.io/pypi/v/django-sslify.svg\n :alt: django-sslify Release\n :target: https://pypi.python.org/pypi/django-sslify\n\n.. image:: https://img.shields.io/pypi/dm/django-sslify.svg\n :alt: django-sslify Downloads\n :target: https://pypi.python.org/pypi/django-sslify\n\n.. image:: https://img.shields.io/travis/rdegges/django-sslify.svg\n :alt: django-sslify Build\n :target: https://travis-ci.org/rdegges/django-sslify\n\n.. image:: https://github.com/rdegges/django-sslify/raw/master/assets/guardian-sketch.png\n :alt: Guardian Sketch\n\n\nMeta\n----\n\n- Author: Randall Degges\n- Email: r@rdegges.com\n- Site: http://www.rdegges.com\n- Status: maintained, active\n\n\nPurpose\n-------\n\nEnabling SSL on your Django site should be easy, easy as in *one-line-of-code\neasy*. That's why I wrote ``django-sslify``!\n\nThe goal of this project is to make it easy for people to force HTTPS on every\npage of their Django site, API, web app, or whatever you're building. Securing\nyour site shouldn't be hard.\n\n\nInstallation\n------------\n\nTo install ``django-sslify``, simply run:\n\n.. code-block:: console\n\n $ pip install django-sslify\n\nThis will install the latest version of the library automatically.\n\nIf you're using `Heroku `_, you should add\n``django-sslify>=0.2`` to your ``requirements.txt`` file:\n\n.. code-block:: console\n\n $ echo 'django-sslify>=0.2.0' >> requirements.txt\n\nOnce you've done this, the next time you push your code to Heroku this library\nwill be installed for you automatically.\n\n\nUsage\n-----\n\nTo use this library, and force SSL across your Django site, all you need to do\nis modify your ``settings.py`` file, and prepend\n``sslify.middleware.SSLifyMiddleware`` to your ``MIDDLEWARE_CLASSES`` setting:\n\n.. code-block:: python\n\n # settings.py\n\n MIDDLEWARE_CLASSES = (\n 'sslify.middleware.SSLifyMiddleware',\n # ...\n )\n\n.. note::\n Make sure ``sslify.middleware.SSLifyMiddleware`` is the first middleware\n class listed, as this will ensure that if a user makes an insecure request\n (*over HTTP*), they will be redirected to HTTPs before any actual\n processing happens.\n\nIf you're using Heroku, you should also add the following settings to your\nDjango settings file:\n\n.. code-block:: python\n\n SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')\n\nThis ensures that Django will be able to detect a secure connection properly.\n\n\nUsing a Custom SSL Port\n***********************\n\nIf your site is running on a non-standard SSL port, you can change\n``django-sslify``'s default redirection behavior by setting a special variable\nin your ``settings.py`` file:\n\n.. code-block:: python\n\n SSLIFY_PORT = 999\n\n\nDisabling SSLify\n----------------\n\nIf you'd like to disable SSLify in certain environments (*for local development,\nor running unit tests*), the best way to do it is to modify your settings file\nand add the following:\n\n.. code-block:: python\n\n SSLIFY_DISABLE = True\n\nYou can also disable SSLify for certain requests only (*useful for exposing\nHTTP-only web hook URLs, etc*) by adding a callable with a single request\nparameter to the ``SSLIFY_DISABLE_FOR_REQUEST`` list. Returning ``True`` from\nyour callable will disable SSL redirects.\n\n.. code-block:: python\n\n SSLIFY_DISABLE_FOR_REQUEST = [\n lambda request: request.get_full_path().startswith('/no_ssl_please')\n ]\n\n\nNotes\n-----\n\nThis code was initially taken from\n`this StackOverflow thread `_.\n\nThis code has been adopted over the years to work on Heroku, and non-Heroku\nplatforms.\n\nIf you're using Heroku, and have no idea how to setup SSL, read\n`this great article `_\nwhich talks about using the new SSL endpoint addon (*which totally rocks!*).\n\n\nNGINX + Infinite Redirect\n-------------------------\n\nIf you're running your Django app behind an Nginx load balancer, and are seeing\ninfinite redirects, the solution is to add the following line:\n\n.. code-block:: text\n\n proxy_set_header X-Forwarded-Proto $scheme;\n\nTo your ``nginx.conf`` file, inside of the relevant ``location`` blocks. This\n`Stack Overflow thread\n`_\nmight also be useful.\n\n\nContributing\n------------\n\nThis project is only possible due to the amazing contributors who work on it!\n\nIf you'd like to improve this library, please send me a pull request! I'm happy\nto review and merge pull requests.\n\nThe standard contribution workflow should look something like this:\n\n- Fork this project on Github.\n- Make some changes in the master branch (*this project is simple, so no need to\n complicate things*).\n- Send a pull request when ready.\n\nAlso, if you're making changes, please write tests for your changes -- this\nproject has a full test suite you can easily modify / test.\n\nTo run the test suite, you can use the following commands:\n\n.. code-block:: console\n\n $ cd django-sslify\n $ python setup.py develop\n $ python manage.py test sslify\n\n\nChange Log\n----------\n\nAll library changes, in descending order.\n\n\nVersion 0.2.5\n*************\n\n**Released December 28, 2014.**\n\n- Adding in new ``SSLIFY_DISABLE_FOR_REQUEST`` setting which allows a user to\n specify functions that can choose to reject SSL -- this is useful for\n situations where you might want to force SSL site-wide EXCEPT in a few\n circumstances (*webhooks that don't support SSL, for instance*).\n\n\nVersion 0.2.4\n*************\n\n**Released on November 23, 2014.**\n\n- Adding the ability to specify a custom SSL port.\n- Totally revamping docs.\n- Changing project logo / mascot thingy ^^\n- Adding new tests for custom SSL ports.", "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/rdegges/django-sslify", "keywords": "django ssl https middleware", "license": "UNLICENSE", "maintainer": null, "maintainer_email": null, "name": "django-sslify", "package_url": "https://pypi.org/project/django-sslify/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-sslify/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/rdegges/django-sslify" }, "release_url": "https://pypi.org/project/django-sslify/0.2.7/", "requires_dist": null, "requires_python": null, "summary": "Force SSL on your Django site.", "version": "0.2.7" }, "last_serial": 1492227, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "37e8732a79b7d537019d3f3f18ca246a", "sha256": "562d019703867f80b7448fa1648f74d32f2c87d64724e66b825396566cbeb58c" }, "downloads": -1, "filename": "django-sslify-0.1.tar.gz", "has_sig": false, "md5_digest": "37e8732a79b7d537019d3f3f18ca246a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 82019, "upload_time": "2012-04-29T01:37:41", "url": "https://files.pythonhosted.org/packages/c1/7b/412ce5a6906178673100bb69b914ce6436834816b0fcd92b579120f18f07/django-sslify-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "31477549dffa018d9b60bd39b1321dba", "sha256": "2e50b1c49693bb4f3dee0fb2346dd49fc13fc400042ff3611b16b07c67a49cf2" }, "downloads": -1, "filename": "django-sslify-0.2.tar.gz", "has_sig": false, "md5_digest": "31477549dffa018d9b60bd39b1321dba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85893, "upload_time": "2012-04-29T23:00:51", "url": "https://files.pythonhosted.org/packages/f1/a3/191aa5b0c7ee9506429c393424640830ba9c5a065d1558c825e8071b247b/django-sslify-0.2.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "f40331b54590912b86f8620b6a830e75", "sha256": "3934364b98e54bc582514e4a85457e61c38465de4976502d6f5419d1ae798641" }, "downloads": -1, "filename": "django-sslify-0.2.2.tar.gz", "has_sig": false, "md5_digest": "f40331b54590912b86f8620b6a830e75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6762, "upload_time": "2013-12-31T21:28:55", "url": "https://files.pythonhosted.org/packages/32/c8/beebc2d20b8401d965c075d68c5ded491d0b9d8486d4fb638c1f1142b42b/django-sslify-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "ce4c9d7284b640ef280819f1ca732652", "sha256": "07238b15bcbea6311947ef12256d000350a44921c412629981d0b12be2f33576" }, "downloads": -1, "filename": "django-sslify-0.2.3.tar.gz", "has_sig": false, "md5_digest": "ce4c9d7284b640ef280819f1ca732652", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7070, "upload_time": "2014-03-09T02:13:24", "url": "https://files.pythonhosted.org/packages/80/11/c462cb23e022357b8a288535ecfa84175d5390c388e1dbe73584783a7a59/django-sslify-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "58bad08c8b34b5a1af3196d52489fffe", "sha256": "3d874e61543ab842142b109b971484692f8204fe7188bbf5cf0fd54b5374c363" }, "downloads": -1, "filename": "django-sslify-0.2.4.tar.gz", "has_sig": false, "md5_digest": "58bad08c8b34b5a1af3196d52489fffe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7110, "upload_time": "2014-11-24T07:20:01", "url": "https://files.pythonhosted.org/packages/2e/ba/45db1446410919f5323e41520f199d52429228c6eecd831ba2dddb88234e/django-sslify-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "596ed171f7f6f2855ab4180664e4123c", "sha256": "8018f2364ef5b1ee125eed88a18a635c5cb1ced91d7b234353d8a07def32c613" }, "downloads": -1, "filename": "django-sslify-0.2.5.tar.gz", "has_sig": false, "md5_digest": "596ed171f7f6f2855ab4180664e4123c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 127350, "upload_time": "2014-12-28T07:31:47", "url": "https://files.pythonhosted.org/packages/20/74/c7a4508d5aa5952d09437c43e061b76930e7333831ef9b7dd8c20dc8963b/django-sslify-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "73b558334c7cbb68844a1e66673a7037", "sha256": "f711e3aff3e535e1b009d03f13352eef261058a6679373d11d054111ee60bbdf" }, "downloads": -1, "filename": "django-sslify-0.2.6.tar.gz", "has_sig": false, "md5_digest": "73b558334c7cbb68844a1e66673a7037", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 127643, "upload_time": "2015-04-05T21:49:47", "url": "https://files.pythonhosted.org/packages/f4/ad/857f1e5fff9a646476e84f953993b3338c058b7f16a9b134ca6fe7bb6fb4/django-sslify-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "aba428b5d1a23fa62beb50b4ee7732af", "sha256": "f6bfd21048c7dfc95b39659a3da77775d6db1c1f7a745805ccc6c6138f783b6d" }, "downloads": -1, "filename": "django-sslify-0.2.7.tar.gz", "has_sig": false, "md5_digest": "aba428b5d1a23fa62beb50b4ee7732af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 127701, "upload_time": "2015-04-06T03:02:34", "url": "https://files.pythonhosted.org/packages/50/43/7d6fee8cd6811a364b960fff46267db88ecef21112233e7f0422fd5a6573/django-sslify-0.2.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aba428b5d1a23fa62beb50b4ee7732af", "sha256": "f6bfd21048c7dfc95b39659a3da77775d6db1c1f7a745805ccc6c6138f783b6d" }, "downloads": -1, "filename": "django-sslify-0.2.7.tar.gz", "has_sig": false, "md5_digest": "aba428b5d1a23fa62beb50b4ee7732af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 127701, "upload_time": "2015-04-06T03:02:34", "url": "https://files.pythonhosted.org/packages/50/43/7d6fee8cd6811a364b960fff46267db88ecef21112233e7f0422fd5a6573/django-sslify-0.2.7.tar.gz" } ] }