Writing a Django e-commerce framework

Writing a Django e-commerce framework

Django is well-suited for e-commerce, and there are currently several nascent django e-commerce frameworks in development. This talk is about the development of django-oscar, a framework designed to leverage Django's core functionality to allow domain-driven e-commerce applications to be built. This is a very powerful approach.

Writing django apps which are flexible enough to be adapted to a wide variety of
scenarios is a non-trivial problem which will be explored. The talk will also
cover a range of e-commerce best practices and how they can be implemented in
Django.

52d39c7b27386ca98bc016119d95b8b8?s=128

David Winterbottom

March 02, 2012
Tweet

Transcript

  1. 2.

    Synopsis • Background / challenges • Why django / python

    • Customising django apps • E-commerce tips
  2. 3.
  3. 4.
  4. 5.
  5. 7.

    • 5 years of e-commerce projects • PHP / Python

    / Django • Lots of war stories
  6. 8.
  7. 9.

    Bookshop domain • Millions of products • ISBNs, BIC categories,

    authors, publishers • Automated feed-driven processing • Catalogue • Stock • Rich data
  8. 10.

    Two tier structure • Application tier - serves HTTP requests

    • Processing tier • Download and import feeds • Data cleaning and processing
  9. 12.

    Different... • Fulfilment partners • Stock logic • Payment partners

    • Multiple payment sources • Complicated offers • eBooks!
  10. 13.

    PHP framework • Customisation via include path overrides • Lots

    of duplication • Hard to upgrade • Not-invented-here syndrome
  11. 15.
  12. 18.

    New requirements • Product variations - colours, sizes etc •

    New fulfilment processes • Pricing models
  13. 19.

    B2B • Sales reps • Tax rules • Managed budgets

    • Integration with “enterprise” software
  14. 21.
  15. 22.

    Requirements • Agnostic - few assumptions as possible • Models

    domain • without duplication • without too much meta-data
  16. 24.
  17. 25.
  18. 28.
  19. 29.
  20. 30.
  21. 31.
  22. 33.
  23. 35.
  24. 36.
  25. 37.

    django-oscar • Django 1.3 • Experience of last 5 years

    baked into models • Lean core • Different customisation path
  26. 38.
  27. 39.

    Lots of others • Satchmo • Lightning-Fast-Shop • Satchless •

    Django-shop • Plata, Mamona, Cartridge, ... • http://djangopackages.com/grids/g/ecommerce/
  28. 40.
  29. 41.
  30. 42.
  31. 43.
  32. 44.
  33. 45.
  34. 47.

    PHP

  35. 48.
  36. 49.
  37. 50.
  38. 51.
  39. 52.
  40. 53.
  41. 54.
  42. 55.
  43. 56.
  44. 57.
  45. 58.

    Web framework • Well-thought out structure • Templating, HTTP, caching,

    ... • Good test support • Security • Class-based views
  46. 59.

    Models • Models drive the design • Capture domain logic

    • Foundation for rest of application
  47. 61.
  48. 67.
  49. 68.
  50. 69.
  51. 70.
  52. 71.
  53. 73.
  54. 75.
  55. 84.
  56. 88.
  57. 93.
  58. 97.

    Recap • Bit of a work-around... • ...but works well

    • Applicable to other django libraries
  59. 101.
  60. 103.

    SOA • Services make your life easier • Keep a

    layer in front of your models • Facade design pattern
  61. 104.
  62. 109.

    Rules of thumb • Keep views lean • Business logic

    in: • Models • Services • Validation logic in forms
  63. 110.
  64. 111.
  65. 112.

    Domain pollution • When integrating with a 3rd party... •

    they will try and push their shortcomings into your platform
  66. 113.
  67. 115.

    Summary • Django e-commerce is an emerging force • Customising

    django apps isn’t easy • Oscar’s future: • NoSQL • Table inheritance
  68. 116.

    Image credits Books: http://www.flickr.com/photos/th3ph17/3091294342/ More books: http://www.flickr.com/photos/cheryl-j/3965942320/ Nail varnish: http://www.flickr.com/photos/greenzowie/5451402463/

    Leather gloves: http://www.flickr.com/photos/theopenseas/175598276/ Lego shipping: http://www.flickr.com/photos/lydiashiningbrightly/5356210011/ Rubber gloves: http://www.flickr.com/photos/recyclethis/139373445/ Warehouse: http://www.flickr.com/photos/23748404@N00/15648677/ Taxonomy: http://www.flickr.com/photos/kqedquest/831547339/ T-shirts: http://www.flickr.com/photos/blazerman/177165473/