Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Oops I Committed My Secret Key
Search
Philip James
July 20, 2016
Technology
0
420
Oops I Committed My Secret Key
Lightning talk given at DjangoCon US 2016
Philip James
July 20, 2016
Tweet
Share
More Decks by Philip James
See All by Philip James
Frog and Toad Learn about Django Security - NBT6
phildini
0
27
The Elephant and the Serpent (PyLatam 2019)
phildini
0
68
Account Security for the Fashionable App Developer
phildini
1
70
All in the Timing: Side-Channel Attacks
phildini
0
67
Giving Thanks
phildini
0
46
All in the Timing: Side-Channel Attacks in Python
phildini
0
420
API-Driven Django
phildini
1
410
Type uWSGI; Press Enter; What Happens?
phildini
0
100
Type uWSGI; Press Enter; What Happens?
phildini
1
81
Other Decks in Technology
See All in Technology
JEDAI認定プログラム JEDAI Order 2026 エントリーのご案内 / JEDAI Order 2026 Entry
databricksjapan
0
130
GitHub Copilotを使いこなす 実例に学ぶAIコーディング活用術
74th
3
3.4k
ExpoのインダストリーブースでみたAWSが見せる製造業の未来
hamadakoji
0
140
Reinforcement Fine-tuning 基礎〜実践まで
ch6noota
0
190
AI時代の新規LLMプロダクト開発: Findy Insightsを3ヶ月で立ち上げた舞台裏と振り返り
dakuon
0
180
プロンプトやエージェントを自動的に作る方法
shibuiwilliam
12
10k
re:Invent2025 コンテナ系アップデート振り返り(+CloudWatchログのアップデート紹介)
masukawa
0
390
生成AIを利用するだけでなく、投資できる組織へ / Becoming an Organization That Invests in GenAI
kaminashi
0
100
非CUDAの悲哀 〜Claude Code と挑んだ image to 3D “Hunyuan3D”を EVO-X2(Ryzen AI Max+395)で動作させるチャレンジ〜
hawkymisc
2
200
AIの長期記憶と短期記憶の違いについてAgentCoreを例に深掘ってみた
yakumo
4
400
Challenging Hardware Contests with Zephyr and Lessons Learned
iotengineer22
0
230
Jakarta Agentic AI Specification - Status and Future
reza_rahman
0
110
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.3k
Unsuck your backbone
ammeep
671
58k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Code Review Best Practice
trishagee
74
19k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
KATA
mclloyd
PRO
33
15k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Balancing Empowerment & Direction
lara
5
800
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
Transcript
Oops I Commi*ed My Secret Key Philip James @phildini h*ps:/
/www.wordfugue.com
$ django-admin.py startproject bestthingever $ git init $ git add
. $ git commit -m "Initial commit” $ git push origin master
None
Wait, have I?
YES. Signed Cookies Secure Sessions Password Reset Tokens
What do I do?
import os import warnings from django.core.exceptions import ImproperlyConfigured def get_env_variable(var_name):
""" Get the environment variable or return exception """ try: return os.environ[var_name] except KeyError: error_msg = "Set the %s env variable" % var_name if DEBUG: warnings.warn(error_msg) else: raise ImproperlyConfigured(error_msg)
SECRET_KEY = get_env_variable("SECRET_KEY")
How do I get a new key?
h*p:/ /www.miniwebtool.com/django-secret-key-generator/ $ python manage.py shell >>> from django.utils.crypto import
get_random_string >>> get_random_string(length=50)
What about my users?
OpOonal: No permanent key
Thanks. @phildini h*p:/ /bit.ly/secret-key Come back at 1:15PM for “Cat
on yer head”!