Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
5
Help us understand the problem. What is going on with this article?
@yunkikki

Djangoでhttpsにリダイレクトする簡単な方法

More than 1 year has passed since last update.

Djangoで作成したサイトをhttpsにリダイレクトさせるにはsetting.pyに以下の二行を追加します。

setting.py
SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

私はDjangoとAWSで自分のサイトを作成しているのですが、この機能を知らずにAWSの設定を変えたり、Apache使ったり苦戦してすごく時間を取られました笑

5
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
yunkikki
Djangoの全てを知りたい🙋‍♀️

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
5
Help us understand the problem. What is going on with this article?