To use the oscarapi application in an oscar ecommerce site without overriding or customizing the default views and serializers just follow these steps:
- Install it (see
django-oscar-api-installation
) - Add
rest_framework
andoscarapi
to your INSTALLED_APPS section insettings.py
- Add the application's urls to your own app's `url.py`:
from oscarapi.app import application as api
urlpatterns = [
# ... all the things you allready got
url(r'^api/', include(api.urls)),
]
There are some middleware classes shipped with Oscar API which can be useful for your project. For example, we have seen in practice that it can be useful to mix plain Oscar and the API (fill your basket with the API and use plain Oscar views for checkout).
See the /usage/middleware
section for more information.