Hello!
I was following the documentation on the django oscar api about use cases and how to customize the django oscar api.
As suggested in the documentation I am using the
ApiBasketMiddleWare in my project in order to be able to mix api calls with regular oscar views.
MIDDLEWARE_CLASSES = [
'oscarapi.middleware.ApiBasketMiddleWare'
]
Then I followed the steps to customize the django oscar api:
Point 4 of the api customizing
documentation states:
Include your own app in INSTALLED_APPS instead of django-oscar-api (and add django-oscar-api to your app’s dependencies) and see if this works.
INSTALLED_APPS = [
.
.
'mycustomapi'
]
If If I define my INSTALLED_APPS like this I get a configuration error since the ApiBasketMiddleware uses the oscarapi models internally.
Howewer If I include both apps in my INSTALLED_APPS configuration like this everything works fine and I can even customize my serializers as described in the documenation.
INSTALLED_APPS = [
.
.
'oscarapi',
'mycustomapi'
]
My question is is this this solution ok for this use case, or should I rather totally fork the oscarapi app and rewrite all references to oscarapi.models to mycustomapi.models in order to use the ApiBasketMiddleware with a customized version of oscarapi?
A thank you to everyone in advance for developing and supporting oscar!
Regards,
Matyas