django-oscar �have few build-in signals for internal use. Sometime we need to interact oscar data with external system (ERP or License Server etc.)
Basic idea is build a UI that stock-parter can register place_order
signals to interact data with external system.
- you should set
ONLY ONE
user for each parter (Book-parter, Clothes-parter). - parter can register a hooks with multiple (signals-type --> URL) rules.
- hooks log dashboard support.
install using pip (have not published)
pip install django-oscar-hooks
install using github
pip install -e git+git@github.com:cage1016/django-oscar-hooks.git#egg=django-oscar-hooks
modify your settings.py
and urls.py
setting.py
# ...
INSTALLED_APPS =[
...
'django_q',
'hooks'
]
# ...
########## HOOK CONFIGRATION
from django.utils.translation import ugettext_lazy as _
OSCAR_DASHBOARD_NAVIGATION.append(
{
'label': _('Hooks'),
'icon': 'icon-info',
'children': [
{
'label': 'Hooks',
'url_name': 'hook-list',
},
{
'label': 'Hooks Types',
'url_name': 'hook-class-list',
},
{
'label': 'Hooks Logs',
'url_name': 'hook-logs',
}
]
})
# redis defaults
Q_CLUSTER = {
'redis': {
'host': 'dockerhost',
'port': 6379,
'db': 0,
'password': None,
'socket_timeout': None,
'charset': 'utf-8',
'errors': 'strict',
'unix_socket_path': None
}
}
########## END HOOK CONFIGRATION
add hooks dashboard to url-pattern
urls.py
from hooks.dashboard.app import application as hooks_dashboard
# ...
urlpatterns = [
...
url(r'^dashboard/hooks/', include(hooks_dashboard.urls)),
]
Running migrate to create django_q
and hooks
appropriate database tables and initial data.
$ manage.py migrate