Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Oops I Committed My Secret Key
Search
Philip James
July 20, 2016
Technology
440
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Oops I Committed My Secret Key
Lightning talk given at DjangoCon US 2016
Philip James
July 20, 2016
More Decks by Philip James
See All by Philip James
3 (or whatever) ways to put something on the internet
phildini
0
20
Frog and Toad Learn about Django Security - NBT6
phildini
0
41
The Elephant and the Serpent (PyLatam 2019)
phildini
0
83
Account Security for the Fashionable App Developer
phildini
1
80
All in the Timing: Side-Channel Attacks
phildini
0
94
Giving Thanks
phildini
0
58
All in the Timing: Side-Channel Attacks in Python
phildini
0
440
API-Driven Django
phildini
1
460
Type uWSGI; Press Enter; What Happens?
phildini
0
120
Other Decks in Technology
See All in Technology
コードレビューをなくして見えたもの
henteko
0
130
あなたのDartコードは丸見えかもしれない ~reFlutterで暴くFlutterアプリの中身と多層防御~
zozotech
PRO
0
750
[General] 개발자로 해외 기업에서 일하기
skydoves
1
260
[re:Invent2026事前勉強会(有志開催)]続きは、ラスベガスの廊下で / continue-in-the-vegas-hallway
sh_fk2
0
500
なぜAI時代に技術記事を書くのか?どう書くのか? 〜bunの場合〜
kworkdev
PRO
0
4.6k
AI時代、つくる力を自分たちの手に。 ──電通×KAG、アジャイルとAI駆動開発で挑む開発の変革
yuukiyo
3
460
増え続けるプロダクトの品質をどう担保するか。ProductSpecとTypeScriptによる取り組み
joere
3
350
kintoneで在庫管理システムを作るときの要件定義・設計ポイント
kai0707
0
220
新卒エンジニア、 介護士になる
ryu1013
1
680
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
510
バックオフィスに染み出すTypeScript ── clasp で安全に仕組みを作る
nealle
1
170
データマネジメント × 法務で作りあげる、 freeeの新しいデータガバナンスへの軌跡
freee
PRO
3
680
Featured
See All Featured
Game over? The fight for quality and originality in the time of robots
wayneb77
1
320
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.5k
Google's AI Overviews - The New Search
badams
0
1.6k
Writing Fast Ruby
sferik
630
63k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
540
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Site-Speed That Sticks
csswizardry
13
1.6k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
870
Rails Girls Zürich Keynote
gr2m
96
14k
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”!