question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redirect to HTTPS

See original GitHub issue

Describe the bug:

Redirect the URL to HTTPS

Screenshots:

image

Solution:

Add the following to the settings.py file, adding the middleware to your existing MIDDLEWARE list if one exists.

MIDDLEWARE = [
    # SecurityMiddleware must be listed before other middleware
    'django.middleware.security.SecurityMiddleware',
    # ...
]

if not DEBUG:      # When we are in production ( DEBUG = False ), the URL will redirect to HTTPS
    SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
    SECURE_SSL_REDIRECT = True    

Source:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gauthampkrishnancommented, May 13, 2021

I can take up this work @PraveenMalethia

1reaction
gauthampkrishnancommented, May 12, 2021

Okay, thanks for the update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Redirect Website from HTTP to HTTPS? - Geekflare
Go to Page Rules · Click “Create Page Rule” · Enter the URL (put the asterisk, so redirection happens for all the URI)...
Read more >
How to redirect all HTTP requests to HTTPS using .htaccess ...
If you want to redirect your users to HTTPS at all times, send them there from the "entry point" (the first link to...
Read more >
Force your site to redirect to HTTPS (SSL)
If your site requires custom code to force the redirect to HTTPS, you will need to update a configuration file for your domain...
Read more >
IIS Redirect HTTP to HTTPS - SSL Certificates - Namecheap
Setting up an HTTP/HTTPS redirect in IIS · Download and install the URL Rewrite module. · Click Add Rule(s) in the right-side menu....
Read more >
How to Redirect HTTP to HTTPS - Semrush
Download the IIS URL Rewrite Module; Go into IIS Manager and select the website that needs redirecting; Select URL Rewrite; Click Add Rules, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found