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
Dajaxproject.com
Search
Jorge Bastida
May 09, 2011
Technology
170
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Dajaxproject.com
Dajaxproject.com, 5m Lighting talk. Djangocon Europe, Amsterdam (Jun. 2011)
Jorge Bastida
May 09, 2011
More Decks by Jorge Bastida
See All by Jorge Bastida
Streetlife Analytics
jorgebastida
1
290
Some non-obvious tips… Scaling Up
jorgebastida
1
300
La historia de todo lo que pudo salir mal... pero salió bien
jorgebastida
8
990
Open Source Modern Web Development
jorgebastida
26
2.6k
Glue
jorgebastida
7
780
Python + Django
jorgebastida
19
2.6k
Things that make me happy
jorgebastida
13
1.3k
Other Decks in Technology
See All in Technology
Adding Right-to-Left support to your web application with CSS logical properties — Lessons from Redmine
vividtone
0
160
同じWAFが、攻撃の“形”は弾く── 正当な“形”の不正は通す
kuroneko13
0
250
英語が話せなくてもKubeConスタッフに参加した話
yusuke427
0
1k
SmartHR Engineering Team Deck
smarthr
1
3.1k
Rust×eBPFでEDRっぽいものをつくる
sunlife3
1
330
作って理解するCoding Agent 〜フレームワークに頼らないピュア Python での実装〜
takapy
1
120
AI開発に用いられるHPC技術について
gpuunite_official
0
180
【GCC2026】大規模言語モデルを活用した内製検索サービスの社内展開や業務活用
bandainamcostudios
PRO
0
350
20260817_生成AIの動向と中学校・高等学校での活用を考える_v1.00_公開用
doradora09
PRO
0
140
カートの信頼性を担保するWireMockを使ったe2eテスト
ykagano
0
620
関東Kaggler会発表資料
takoi
1
270
長期運営で肥大化したExcelマスターデータの解消に向けた移行事例
gree_tech
PRO
0
100
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
GraphQLとの向き合い方2022年版
quramy
50
15k
Darren the Foodie - Storyboard
khoart
PRO
3
3.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
290
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
250
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
490
Transcript
dajaxproject.com Jorge Bas*da @jorgebas*da jorgebas*da.com
dajaxproject.com?
dajaxproject.com • Set of easy to use AJAX libraries for
django. • django-‐dajaxice • communica*on core. • send data to your browser asynchronously. • django-‐dajax • manipulate the DOM using python.
@github Forks Watchers django-‐dajax 6 110 django-‐dajaxice 10 95 hKps://github.com/jorgebas*da/django-‐dajax/
hKps://github.com/jorgebas*da/django-‐dajaxice/
@github Forks Watchers django-‐dajax 6 110 django-‐dajaxice 10 95 hKps://github.com/jorgebas*da/django-‐dajax/
hKps://github.com/jorgebas*da/django-‐dajaxice/ It’s not enormous, but I’m really happy :)
dajaxice aims • Uniform communica*on between the client and the
server. • JS Framework agnos:c. • No Prototype, jQuery... required. • Presenta*on logic outside the views. • No presenta*on code inside ajax func*ons. • Crossbrowsing ready.
STFU... Show me the code
Example from django.utils import simplejson from dajaxice.decorators import dajaxice_register @dajaxice_register
def my_example(request): return simplejson.dumps({'message':'Hello World'})
Example from django.utils import simplejson from dajaxice.decorators import dajaxice_register @dajaxice_register
def my_example(request): return simplejson.dumps({'message':'Hello World'}) Yes. It’s a function that returns json
Example function on_whatever(){ Dajaxice.example.my_example(my_js_callback); }
Example function on_whatever(){ Dajaxice.example.my_example(my_js_callback); } app name function name callback
Example function my_js_callback(data){ alert(data.message); }
Example function my_js_callback(data){ alert(data.message); } callback your stuff
Installa:on {% load dajaxice_templatetags %} <html> <head> <title>My base template</title>
... {% dajaxice_js_import %} </head> ... </html>
Installa:on {% load dajaxice_templatetags %} <html> <head> <title>My base template</title>
... {% dajaxice_js_import %} </head> ... </html> automagically add the required js * * It could/should be served sta*cally for produc*on.
And django-‐dajax?
dajax = sugar to dajaxice
django-‐dajax ✦ Manipulate the DOM through python. ✦ Nearly 0
js knowledge required. ✦ Supports some JS frameworks like...
django-‐dajax ✦ Manipulate the DOM through python. ✦ Nearly 0
js knowledge required. ✦ Supports some JS frameworks like... coupling boooo
Internally
the code from dajax.core.Dajax import Dajax def assign_test(request): dajax =
Dajax() dajax.assign('#list li','innerHTML','Hello!') dajax.add_css_class('#list li','new') ... return dajax.json()
the code from dajax.core.Dajax import Dajax def assign_test(request): dajax =
Dajax() dajax.assign('#list li','innerHTML','Hello!') dajax.add_css_class('#list li','new') ... return dajax.json() your actions
the code function on_whatever(){ Dajaxice.app.assign_test(Dajax.process); }
the code function on_whatever(){ Dajaxice.app.assign_test(Dajax.process); } Dajax callback
DEMO
Thanks Jorge Bas*da @jorgebas*da jorgebas*da.com