2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00
2022-01-11 01:00:41 +01:00

25 lines
472 B
Python

"""
URL lookup for plugin app
"""
from django.conf.urls import url, include
from plugin import registry
PLUGIN_BASE = 'plugin' # Constant for links
def get_plugin_urls():
"""
Returns a urlpattern that can be integrated into the global urls
"""
urls = []
for plugin in registry.plugins.values():
if plugin.mixin_enabled('urls'):
urls.append(plugin.urlpatterns)
return url(f'^{PLUGIN_BASE}/', include((urls, 'plugin')))