Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Look Behind the Curtain
Search
Senko Rašić
November 14, 2017
Programming
0
120
Look Behind the Curtain
A Python Zagreb meetup talk about why we should not be afraid of poking into someone else's code.
Senko Rašić
November 14, 2017
Tweet
Share
More Decks by Senko Rašić
See All by Senko Rašić
Online audio and video using free software and open standards
senko
1
64
Streamanje glazbe pomoću Go-a
senko
1
80
Chasing the Ghost
senko
1
120
Real Time Web with Django Channels
senko
1
180
Building highly available and fault tolerant sites on a budget
senko
1
430
Simple REST with Django
senko
1
94
Building good Web APIs
senko
0
160
Detecting duplicate SQL queries in Django
senko
1
980
Python 3: Zašto i kako
senko
1
160
Other Decks in Programming
See All in Programming
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
130
バイブスあるコーディングで ~PHP~ 便利ツールをつくるプラクティス
uzulla
1
330
AIコーディングエージェント全社導入とセキュリティ対策
hikaruegashira
16
9.6k
抽象化という思考のツール - 理解と活用 - / Abstraction-as-a-Tool-for-Thinking
shin1x1
1
950
The State of Fluid (2025)
s2b
0
120
JetBrainsのAI機能の紹介 #jjug
yusuke
0
200
SQLアンチパターン第2版 データベースプログラミングで陥りがちな失敗とその対策 / Intro to SQL Antipatterns 2nd
twada
PRO
38
11k
Webinar: AI-Powered Development: Transformiere deinen Workflow mit Coding Tools und MCP Servern
danielsogl
0
110
実践!App Intents対応
yuukiw00w
1
230
AIのメモリー
watany
13
1.4k
MCP連携で加速するAI駆動開発/mcp integration accelerates ai-driven-development
bpstudy
0
290
AIに安心して任せるためにTypeScriptで一意な型を作ろう
arfes0e2b3c
0
340
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Git: the NoSQL Database
bkeepers
PRO
431
65k
Agile that works and the tools we love
rasmusluckow
329
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Scaling GitHub
holman
461
140k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Mobile First: as difficult as doing things right
swwweet
223
9.9k
Building Adaptive Systems
keathley
43
2.7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.3k
Transcript
Look behind the curtain Senko Rašić
None
None
None
“When the getDVRConversions is set to True it expires conversions
automatically.” —paid support Proprietary software
Open Source
None
None
None
None
None
None
None
Sign in with Google * *authorized users only
from allauth.socialaccount.adapter import \ DefaultSocialAccountAdapter class MyAdapter(DefaultSocialAccountAdapter): def is_open_for_signup(self, request):
return False
from allauth.socialaccount.adapter import \ DefaultSocialAccountAdapter class MyAdapter(DefaultSocialAccountAdapter): def is_open_for_signup(self, req,
sociallogin): return False
from allauth.socialaccount.adapter import \ DefaultSocialAccountAdapter class MyAdapter(DefaultSocialAccountAdapter): def is_open_for_signup(self, req,
sociallogin): return False
Django Developer Tragedies AllAuth won’t log in without SocialAccount, but
won’t create SocialAccount without signup.
We need to go deeper
allauth.socialaccount.views.SignupView
a.sa.providers.google.views.oauth2_login a.sa.providers.oauth2.views.OAuth2LoginView ↓ ↓ a.sa.providers.google.views.oauth2_callback a.sa.providers.oauth2.views.OAuth2CallbackView ↓ allauth.socialaccount.views.SignupView
class OAuth2CallbackView(OAuth2View): def dispatch(self, request): … login = self.adapter.complete_login(…) …
return complete_social_login(request, login) ↓ # allauth.socialaccount.helpers def _complete_social_login(req, sociallogin): … if sociallogin.is_existing: … else: ret = _process_signup(req, sociallogin) ↓ # allauth.socialaccount.models class SocialLogin(object): @property def is_existing(self): return self.account.pk
None
# a.sa.provider.google.views class GoogleOAuth2Adapter(OAuth2Adapter): def complete_login(…): … login = self.get_provider().
\ sociallogin_from_response(…) ↓ # a.sa.providers.base class Provider(object): def sociallogin_from_response(…): … sociallogin.user = adapter.new_user(req, sociallogin) … ↓
None
# allauth.socialaccount.models class SocialLogin(object): @property def is_existing(self): return self.account.pk
None
None
# allauth.socialaccount.helpers def complete_social_login(request, sociallogin): assert not sociallogin.is_existing …
None
None
千⾥里里之⾏行行,始於⾜足下 Debugging of thousand lines starts with a single step
Thank you! @senkorasic