Using in other projects - Semprini/cbe GitHub Wiki

If you want to use the classes in other projects this project can be included in requirements.txt of your project:

django>=1.8.5
djangorestframework>=3.5.2
markdown>=2.6.7
django-filter>=0.15.3
git+https://github.com/Semprini/cbe.git#egg=cbe

Note: Don't rely on me - fork this so you can manage your own dependencies.

pip install -r requirements.txt

This will install cbe into your site packages and allow you to add it to your installed_apps in settings.py:

INSTALLED_APPS = (
    ...
    'rest_framework',
    'cbe.party',
    'cbe.location',
    'cbe.business_interaction',)

To add the classes to the rest interface we grab the router from cbe.urls and include it in the new projects urls.py: from cbe.urls import cberouter

router = DefaultRouter()
...add your routes here...

for route in cberouter.registry:
    router.register(route[0],route[1])

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^api/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),]