Repository: openwisp/openwisp-controller (language: python)

Issue:
[bug] PKI REST API URLs are not included in openwisp_controller.urls
The URLs have been included in the project root urls.py but it should be included in openwisp_controller.urls like URLs of other applications. 


Discussion / hints:

Fix patch:
diff --git a/openwisp_controller/urls.py b/openwisp_controller/urls.py
index d67d56f2c..e1cae25ed 100644
--- a/openwisp_controller/urls.py
+++ b/openwisp_controller/urls.py
@@ -20,6 +20,12 @@
         'app': 'openwisp_controller.pki',
         'include': {'module': '{app}.urls', 'namespace': 'x509'},
     },
+    # openwisp_controller.pki.api
+    {
+        'regexp': r'^api/v1/',
+        'app': 'openwisp_controller.pki',
+        'include': {'module': '{app}.api.urls', 'namespace': 'pki_api'},
+    },
     # openwisp_controller controller
     {
         'regexp': r'^',


Test patch:
diff --git a/tests/openwisp2/urls.py b/tests/openwisp2/urls.py
index 554473313..8895f674f 100644
--- a/tests/openwisp2/urls.py
+++ b/tests/openwisp2/urls.py
@@ -63,7 +63,6 @@
     path('accounts/', include('openwisp_users.accounts.urls')),
     path('api/v1/', include('openwisp_utils.api.urls')),
     path('api/v1/', include(('openwisp_users.api.urls', 'users'), namespace='users')),
-    path('api/v1/', include(('openwisp_controller.pki.api.urls'), namespace='pki_api')),
 ]
 
 urlpatterns += staticfiles_urlpatterns()