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   •	  communica9on	...
@github                      Forks           Watchers django-­‐dajax         6                110django-­‐dajaxice      10...
dajaxice	  aims•	  Uniform	  communica9on	  between	  the	  client	  and	  the	  server.•	  JS	  Framework	  agnos2c.  •	 ...
STFU...	  Show	  me	  the	  code
Examplefrom django.utils import simplejsonfrom dajaxice.decorators import dajaxice_register@dajaxice_registerdef my_exampl...
Example                        functi                                 on na                                      mefunctio...
Example               callbackfunction my_js_callback(data){    alert(data.message);}       yo ur s tuff
Installa@on {% load dajaxice_templatetags %} <html>   <head>                                            auto ma  g ically ...
And	  django-­‐dajax?
dajax	  =	  sugar	  to	  dajaxice
django-­‐dajax                                                      co upl                                                ...
Internally
the	  codefrom dajax.core.Dajax import Dajaxdef assign_test(request):    dajax = Dajax()    dajax.assign(#list li,innerHTM...
the	  codefunction on_whatever(){    Dajaxice.app.assign_test(Dajax.process);}                                    Dajax   ...
DEMO
Thanks  Jorge	  Bas*da  @jorgebas*dajorgebas*da.com
Upcoming SlideShare
Loading in …5
×

djangocon dajaxproject lightning talk

1,322 views

Published on

My djangocon dajaxproject lightning talk.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,322
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

djangocon dajaxproject lightning talk

  1. 1. dajaxproject.com Jorge  Bas*da @jorgebas*da jorgebas*da.com
  2. 2. dajaxproject.com?
  3. 3. dajaxproject.com•  Set  of  easy  to  use  AJAX  libraries  for  django.•  django-­‐dajaxice •  communica9on  core. •  send  data  to  your  browser  asynchronously.•  django-­‐dajax •  manipulate  the  DOM  using  python.
  4. 4. @github Forks Watchers django-­‐dajax 6 110django-­‐dajaxice 10 95 o us, b ut I’m enor m It’s not pp y :) really ha h@ps://github.com/jorgebas*da/django-­‐dajax/ h@ps://github.com/jorgebas*da/django-­‐dajaxice/
  5. 5. dajaxice  aims•  Uniform  communica9on  between  the  client  and  the  server.•  JS  Framework  agnos2c. •  No  Prototype,  jQuery...  required.•  Presenta9on  logic  outside  the  views. •  No  presenta9on  code  inside  ajax  func9ons.•  Crossbrowsing  ready.
  6. 6. STFU...  Show  me  the  code
  7. 7. Examplefrom django.utils import simplejsonfrom dajaxice.decorators import dajaxice_register@dajaxice_registerdef my_example(request): return simplejson.dumps({message:Hello World}) a fu nction Ye s. It’s eturn s json t hat r
  8. 8. Example functi on na mefunction on_whatever(){ Dajaxice.example.my_example(my_js_callback);} pp name back a call
  9. 9. Example callbackfunction my_js_callback(data){ alert(data.message);} yo ur s tuff
  10. 10. Installa@on {% load dajaxice_templatetags %} <html> <head> auto ma g ically <title>My base template</title> ... ad d the e d js * {% dajaxice_js_import %} </head> requir ... </html>*  It  could/should  be  served  sta*cally  for  produc*on.
  11. 11. And  django-­‐dajax?
  12. 12. dajax  =  sugar  to  dajaxice
  13. 13. django-­‐dajax co upl ing bo o o o  Manipulate  the  DOM  through  python.✦  Nearly  0  js  knowledge  required.✦  Supports  some  JS  frameworks  like...✦
  14. 14. Internally
  15. 15. the  codefrom dajax.core.Dajax import Dajaxdef assign_test(request): dajax = Dajax() dajax.assign(#list li,innerHTML,Hello!) dajax.add_css_class(#list li,new) ... return dajax.json() yo ur ac t io ns
  16. 16. the  codefunction on_whatever(){ Dajaxice.app.assign_test(Dajax.process);} Dajax callback
  17. 17. DEMO
  18. 18. Thanks Jorge  Bas*da @jorgebas*dajorgebas*da.com

×