Skip to main content

django-hstsmiddleware

Forces the use of HTTPS using HTTP Strict Transport Security (HSTS).

Installation and Usage

Install the package, add django_hstsmiddleware to settings.INSTALLED_APPS, and add django_hstsmiddleware.middleware.HSTSMiddleware to the top of settings.MIDDLEWARE_CLASSES.

The following Django settings control its default behaviour:

settings.HSTS_REDIRECT_TO:

Specifies the URI to redirect a User Agent to, if it tries to use a non-secure connection. Responds with HTTP Moved Permanently.

Defaults to None, so no redirect occurs. Instead, responds with HTTP Bad Request.

settings.HSTS_MAX_AGE:

The maximum number of seconds that a User Agent will remember that this server must be contacted over HTTPS.

Defaults to 31536000, or approximately one year.

settings.HSTS_INCLUDE_SUBDOMAINS:

If true, tells a User Agent that all subdomains must also be contacted over HTTPS, in addition to the current domain.

Defaults to False

Metadata

Release files for django-hstsmiddleware 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-hstsmiddleware 1.0
File Size Uploaded Provenance Actions
django-hstsmiddleware-1.0.tar.gz 5.2 kB Without provenance Details for django-hstsmiddleware-1.0.tar.gz

Release files / django-hstsmiddleware-1.0.tar.gz

Download URL django-hstsmiddleware-1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e3c03c8d58909c2abc9059ca19a1451fd9fa659e39d14697abe5c9a4b0f7509a
BLAKE2b-256 checksum
How to use checksums
4b62ac6c7d239c4955bc2e733dd592ae7775a43702d7fd47a2618b6e56b9b591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-hstsmiddleware 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page