Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

317
Views
Secure_ssl_redirect setting for django does nothing on heroku

I am deploying a Django app on heroku and trying to force https on all pages. I use the following settings for that:

SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

Now when I visit www.mysite.de it does in fact not redirect me to https. Any ideas what I am missing?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try adding the following to your settings.py:

PREPEND_WWW = True
BASE_URL = "https://www.mysite.de"
ALLOWED_HOSTS = ['www.mysite.de', 'mysite.de']

Make sure you also have SecurityMiddleware and CommonMiddleware enabled.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!