Integration of TatuJS with Django.
Run the included setup.py
.
Add tatujs.middleware.ExtractorMiddleware
to your MIDDLEWARE_CLASSES
setting in your django project.
// The middleware included will look for this HTTP header.
tatu.configuration.headerName = 'X-Source'; // <= Sources header
tatu.configuration.extractor = 'silent';
tatu.configuration.reload = false;
tatu.configuration.targetSymbol = '>>';
tatu.configuration.concurrency = 42;
tatu.configuration.sources = {
/*
* Pages of the menu
*/
'.navbar a': {
'loader': 'html',
'selectors': 'title,.container,.navbar',
'handlers': 'title,outer,history,inspect,event',
'cache': 'object',
'sources': {
'img': {
'loader': 'image'
},
'video': {
'loader': 'video',
'minBuffered': 10
}
}
},
/*
* Tabs inside Page 0
*/
'.tatu-tabs a': {
'loader': 'html',
'selectors': 'title,.tatu-tab-content,.tatu-tabs',
'handlers': 'title,outer,inspect,event',
'cache': 'object'
}
};
An example is included. Enable the middleware, add tatujs.demo
to your INSTALLED_APPS
, and add the following to your main urlconf.
url(r'^demo/', include('tatujs.demo.urls')),
django-tatujs is Copyright (c) 2017 sophilabs, inc. It is free software, and may be redistributed under the terms specified in the license file.
django-tatujs is maintained and funded by sophilabs, inc. The names and logos for sophilabs are trademarks of sophilabs, inc.