Django-Oscar - Backend Customization - Part 7

Documentation:
https://django-oscar.readthedocs.io/en/latest/topics/fork_app.html
https://github.com/django-oscar/django-oscar

Backend customization also refered to as «forking» will allow us to modify core functionalities if necessary.

Django-Oscar contains the following Django apps:

  • Address
  • Analytics
  • Basket
  • Catalogue
  • Checkout
  • Communication
  • Customer
  • Dashboard
  • Offers
  • Order
  • Partner
  • Payment
  • Search
  • Shipping
  • Voucher
  • Wishlists

To manage shipping or to add new payment methods it's necessary to adjust the backend code to our needs, these are possible reasons to fork an app.



Forking an app

 

  1. python manage.py oscar_fork_app shipping myShipping
  2. INSTALLED_APPS = [
        ...
        # 'oscar.apps.shipping.apps.ShippingConfig',
        'myShipping.shipping.apps.ShippingConfig',
        ...
    ]

    Replace the Django-Oscar installed app, by your extend app.
     

  3. In mysite/myShipping/shipping create methods.py and repository.py


    Your directories should look like this  

     

  4. By importing the Django-Oscar correspondent file content, we are then set to modify its core functions. As the main focus of this post is to talk about forking, in the next post we continue and configure different shipping methods.