0
0

More than 1 year has passed since last update.

Djangoからherokuへデプロイ時のSECRET KEYの設定(Win10)

Posted at

問題

Djangoで作成したアプリをherokuへデプロイしようとしたときに、SECRET KEYが反映されずに困った。

解決方法

SECRET KEYの括弧やアンド [ (, ), & ] が原因で認識しているみたい。
上記の記号を""(ダブルクオート)で囲むことでherokuにSECRET KEYの環境変数を指定できた。

& 'heroku' @('config:set', 'SECRET_KEY=eoik6-"&"dnr9elgmrt7-%3hu_"&"37$3hg!9c6x!^khjr3!z*z"&"b4')

(SECRET KEYはそれぞれのアプリのもので設定)

参考:
https://stackoverflow.com/questions/32130105/setting-environment-variable-in-heroku-via-powershell-with-special-characters?rq=1

環境

PowerShell(Bashでは反映できなかった)
Django 3.2.7
Python 3.9.5

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0