<!-- A built-in kolibri URL --> {% url 'kolibri:url_name' %} <!-- A plugin URL --> {% url 'kolibri:pluginnamespace:url_name' %} Defining URLs for plugins ------------------------- Plugin classes can define url modules, and they will automatically be included. Place a url.py and have your plugin's definition class's ``url_module`` method return the module. """ from __future__ import absolute_import, print_function, unicode_literals from django.conf import settings from django.conf.urls import url from kolibri.plugins.registry import get_urls as plugin_urls app_name = 'kolibri' urlpatterns = plugin_urls() urlpatterns += [ url(r'^' + settings.STORAGE_URL[1:-1] + '(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STORAGE_ROOT}) ]
Reverse lookups --------------- Kolibri uses the ``'kolibri'`` namespace. To point to something in Kolibri, use the following lookup pattern: .. code-block:: html+django <!-- A built-in kolibri URL --> {% url 'kolibri:url_name' %} <!-- A plugin URL --> {% url 'kolibri:pluginnamespace:url_name' %} Defining URLs for plugins ------------------------- Plugin classes can define url modules, and they will automatically be included. Place a url.py and have your plugin's definition class's ``url_module`` method return the module. """ from __future__ import absolute_import, print_function, unicode_literals from kolibri.plugins.registry import get_urls as plugin_urls app_name = 'kolibri' urlpatterns = plugin_urls()