Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Avatar for David Winterbottom

David Winterbottom

March 02, 2012
Tweet

More Decks by David Winterbottom

Other Decks in Programming

Transcript

  1. Synopsis • Background / challenges • Why django / python

    • Customising django apps • E-commerce tips
  2. • 5 years of e-commerce projects • PHP / Python

    / Django • Lots of war stories
  3. Bookshop domain • Millions of products • ISBNs, BIC categories,

    authors, publishers • Automated feed-driven processing • Catalogue • Stock • Rich data
  4. Two tier structure • Application tier - serves HTTP requests

    • Processing tier • Download and import feeds • Data cleaning and processing
  5. Different... • Fulfilment partners • Stock logic • Payment partners

    • Multiple payment sources • Complicated offers • eBooks!
  6. PHP framework • Customisation via include path overrides • Lots

    of duplication • Hard to upgrade • Not-invented-here syndrome
  7. New requirements • Product variations - colours, sizes etc •

    New fulfilment processes • Pricing models
  8. B2B • Sales reps • Tax rules • Managed budgets

    • Integration with “enterprise” software
  9. Requirements • Agnostic - few assumptions as possible • Models

    domain • without duplication • without too much meta-data
  10. django-oscar • Django 1.3 • Experience of last 5 years

    baked into models • Lean core • Different customisation path
  11. Lots of others • Satchmo • Lightning-Fast-Shop • Satchless •

    Django-shop • Plata, Mamona, Cartridge, ... • http://djangopackages.com/grids/g/ecommerce/
  12. PHP

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

    ... • Good test support • Security • Class-based views
  14. Models • Models drive the design • Capture domain logic

    • Foundation for rest of application
  15. Recap • Bit of a work-around... • ...but works well

    • Applicable to other django libraries
  16. SOA • Services make your life easier • Keep a

    layer in front of your models • Facade design pattern
  17. Rules of thumb • Keep views lean • Business logic

    in: • Models • Services • Validation logic in forms
  18. Domain pollution • When integrating with a 3rd party... •

    they will try and push their shortcomings into your platform
  19. Summary • Django e-commerce is an emerging force • Customising

    django apps isn’t easy • Oscar’s future: • NoSQL • Table inheritance
  20. 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/