django-oscar-support has been tested with Oscar 0.6 master
(due to it’s pre-release state) and only works with commit 4aea545de3
or later. Due to major changes in the stock record architecture and the
customer account templates earlier version will not work with the
instructions below.

The following few steps will walk you through setting up the support system
within your existing Oscar project. If you don’t have Oscar setup already, take
a look at the documentation for Oscar on how to setup your shop.

The support system hooks into two different places of Oscar: the profile of a
customer and the dashboard for support agents. django-oscar-support provides
a default UI for these two entry points but they need to be hooked into your
Oscar project. Let’s start by adding the URL patterns to your current project
by adding the following line into your urls.py file:

This will provide all the URLs required to interact with the support system.
The next step is to make the dashboard UI available in the navigation using
Oscar’s OSCAR_DASHBOARD_NAVIGATION settings:

# import this if you want to make the label below translatablefromdjango.utils.translationimportugettext_lazyas_....OSCAR_DASHBOARD_NAVIGATION=OSCAR_DASHBOARD_NAVIGATION+[{'label':_("Support"),'icon':'icon-comments','url_name':'support-dashboard:ticket-list',}]

Note

Make sure that you aren’t using OSCAR_DASHBOARD_NAVIGATION+=
because this will cause duplicate entries due to a bug in Django that will
only be fixed in version 1.6+

All that is left to do now is integrating the customer-facing part of the
support system. The templates that come with django-oscar-support extend
Oscar’s customer account templates and should pick up the styles that are
defined there following Oscar’s template customisation process. If you are not
sure how this works, take a look at How to customise templates in the Oscar
docs.

Let’s look at a simple way to add the customer-facing side of the support
system into the customer’s profile page. We can achieve that by integrating a
link to the ticket overview page into the customer profile navigation. The
first thing to do is to create customer/baseaccountpage.html in your
template directory and add the following content:

This adds a Support navigation element to the end of the profile
navigation. If you are using a more customised set of templates it might be
better to take a look at the templates in oscar_support/templates and
integrate extended templates into your own template directory.

django-oscar-support provides and uses a RESTful API for serveral resources
such as the User. We use django-rest-framework (DRF) to provide the API URLs
and render the data into a RESTful format. This also provides authentication
mechanisms that can easily configured in the the settings file. We provide
sensible defaults for this in oscar_support.defaults that you probably
added to your settings already if you followed the instructions above.

The default configuration for DRF restricts API usage to session-based
authentication and only provides JSON as serialisation format. We also disable
the browsable API provided by DRF to avoid accidentally exposing it in
production. You can change all of these settings by overriding the
REST_FRAMEWORK dictionary in your settings file. For more info on settings
available for DRF take a look at their excellent documentation.