Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to django (and py)

1,097 views

Published on

Introduction to django (and py)

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Introduction to django (and py)

  1. 1. Introduction To Django (+ py)<br />Adrian Andreiaș, Elvsoft<br />http://twitter.com/adiandreias<br />
  2. 2. <ul><li>Worked as software engineer (C++, C#)
  3. 3. Graduated UBB, Cluj in 2003
  4. 4. Founded Elvsoft in 2004
  5. 5. PHP, then switched to Python & Django
  6. 6. Currently internet hosting & tools</li></ul>Shameless self promotion<br />
  7. 7. Short look at Python<br />Introduction To Django<br />Django live coding: A Digg app<br />Summary<br />
  8. 8. <ul><li>interpreted, general-purpose high-level programming language
  9. 9. design philosophy emphasizes code readability
  10. 10. combine "remarkable power with very clear syntax“
  11. 11. batteries included</li></ul>Python goals<br />
  12. 12. ...<br /><ul><li>Readability counts.
  13. 13. There should be one-- and preferably only one --obvious way to do it.</li></ul>...<br /><ul><li>If the implementation is hard to explain, it's a bad idea.</li></ul>…<br />The Zen of Python<br />
  14. 14. Python syntax<br />
  15. 15. <ul><li>dynamic typed
  16. 16. duck typed = name resolution (late binding)“if it walks like a duck, and quacks like a duck, then it is a duck"</li></ul>Python is<br />
  17. 17. Fully:<br /><ul><li>object-oriented programming
  18. 18. structured programming</li></ul>Elements of:<br /><ul><li>functional programming
  19. 19. aspect-oriented programming</li></ul>Python paradigms<br />
  20. 20. <ul><li>(google) Python tutorial
  21. 21. (google) Dive Into Python</li></ul>Learning Python<br />
  22. 22. <ul><li>The Web framework for perfectionists with deadlines
  23. 23. Django makes it easier to build better Web apps more quickly and with less code.</li></ul>Django is<br />
  24. 24. <ul><li>Loose coupling
  25. 25. Less code
  26. 26. Quick development
  27. 27. DRY (Don't Repeat Yourself)
  28. 28. Explicit is better than implicit
  29. 29. Consistency
  30. 30. Encourage best practices</li></ul>Django philosophy<br />
  31. 31. <ul><li>Python developers should (mainly) write Python code (not YAML, XML, SQL)
  32. 32. No generated code
  33. 33. Use introspection, Luke!
  34. 34. Web development done right:
  35. 35. validations
  36. 36. separation of concerns
  37. 37. clean URLs
  38. 38. take care sql and mail form injections etc.</li></ul>Some Django principles<br />
  39. 39. <ul><li>MTV instead of MVC
  40. 40. Models: Object-relational mapper
  41. 41. Template engine
  42. 42. Views: python functions, Request in, Response out
  43. 43. URL mapping: list of regular expressions</li></ul>Django components<br />
  44. 44. Models<br />
  45. 45. urls.py<br />
  46. 46. Views<br />
  47. 47. Templates (with inheritance!)<br />
  48. 48. <ul><li>Automatic admin interface
  49. 49. Cache system
  50. 50. Internationalization
  51. 51. Authentication & authorization
  52. 52. Form processing and form sets</li></ul>Django free stuff<br />
  53. 53. Coding a DIGG app<br />
  54. 54. Other questions?<br />?<br />

×