datasette-redirect-to-https by simonw

Star

README

datasette-redirect-to-https

PyPI Changelog Tests License

Datasette plugin that redirects all non-https requests to https

Installation

Install this plugin in the same environment as Datasette.

$ datasette install datasette-redirect-to-https

Usage

Once installed, incoming GET requests to the http:// protocol will be 301 redirected to the https:// equivalent page.

HTTP verbs other than GET will get a 405 Method Not Allowed HTTP error.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-redirect-to-https
python3 -mvenv venv
source venv/bin/activate

Or if you are using pipenv:

pipenv shell

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest