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
1
130
Dajaxproject.com
Dajaxproject.com, 5m Lighting talk. Djangocon Europe, Amsterdam (Jun. 2011)
Jorge Bastida
May 09, 2011
Tweet
Share
More Decks by Jorge Bastida
See All by Jorge Bastida
Streetlife Analytics
jorgebastida
1
260
Some non-obvious tips… Scaling Up
jorgebastida
1
260
La historia de todo lo que pudo salir mal... pero salió bien
jorgebastida
8
960
Open Source Modern Web Development
jorgebastida
26
2.6k
Glue
jorgebastida
7
740
Python + Django
jorgebastida
19
2.6k
Things that make me happy
jorgebastida
13
1.3k
Other Decks in Technology
See All in Technology
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
490
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
180
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
複雑なState管理からの脱却
sansantech
PRO
1
160
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
1
120
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
170
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
Lambdaと地方とコミュニティ
miu_crescent
2
370
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
2
460
心が動くエンジニアリング ── 私が夢中になる理由
16bitidol
0
100
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
How to Ace a Technical Interview
jacobian
276
23k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Embracing the Ebb and Flow
colly
84
4.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
How to train your dragon (web standard)
notwaldorf
88
5.7k
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