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
140
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
270
Some non-obvious tips… Scaling Up
jorgebastida
1
270
La historia de todo lo que pudo salir mal... pero salió bien
jorgebastida
8
970
Open Source Modern Web Development
jorgebastida
26
2.6k
Glue
jorgebastida
7
750
Python + Django
jorgebastida
19
2.6k
Things that make me happy
jorgebastida
13
1.3k
Other Decks in Technology
See All in Technology
NewSQLや分散データベースを支えるRaftの仕組み - 仕組みを理解して知る得意不得意
hacomono
PRO
2
160
Lazy application authentication with Tailscale
bluehatbrit
0
210
ビギナーであり続ける/beginning
ikuodanaka
3
760
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
2
7.8k
高速なプロダクト開発を実現、創業期から掲げるエンタープライズアーキテクチャ
kawauso
2
9.4k
Glacierだからってコストあきらめてない? / JAWS Meet Glacier Cost
taishin
1
160
Getting to Know Your Legacy (System) with AI-Driven Software Archeology (WeAreDevelopers World Congress 2025)
feststelltaste
1
130
スタートアップに選択肢を 〜生成AIを活用したセカンダリー事業への挑戦〜
nstock
0
200
生成AI開発案件におけるClineの業務活用事例とTips
shinya337
0
260
LangSmith×Webhook連携で実現するプロンプトドリブンCI/CD
sergicalsix
1
230
ビズリーチにおけるリアーキテクティング実践事例 / JJUG CCC 2025 Spring
visional_engineering_and_design
1
120
freeeのアクセシビリティの現在地 / freee's Current Position on Accessibility
ymrl
2
200
Featured
See All Featured
Producing Creativity
orderedlist
PRO
346
40k
Making Projects Easy
brettharned
116
6.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
950
Thoughts on Productivity
jonyablonski
69
4.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Typedesign – Prime Four
hannesfritz
42
2.7k
Optimizing for Happiness
mojombo
379
70k
Facilitating Awesome Meetings
lara
54
6.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
A better future with KSS
kneath
238
17k
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