From dec3adf0abb55a8a301211b94297ba9a12469d03 Mon Sep 17 00:00:00 2001 From: Asghar Syed <47123144+asgharsir@users.noreply.github.com> Date: Wed, 21 Jul 2021 08:49:35 +0100 Subject: [PATCH] [FIXES #344] Real Cause of 'rest_framework namespace is not Unique' is not Fixed (#345) * [FIXES #344] Real Cause of 'rest_framework namespace is not Unique' is not fixed * added a comment * removed rest_framework.urls --- geonode_mapstore_client/apps.py | 4 +++- mapstore2_adapter/api/urls.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/geonode_mapstore_client/apps.py b/geonode_mapstore_client/apps.py index 5115312928..838705223f 100644 --- a/geonode_mapstore_client/apps.py +++ b/geonode_mapstore_client/apps.py @@ -10,6 +10,7 @@ ######################################################################### from django.apps import AppConfig as BaseAppConfig from django.utils.translation import ugettext_lazy as _ +from django.apps import apps def run_setup_hooks(*args, **kwargs): @@ -28,5 +29,6 @@ class AppConfig(BaseAppConfig): label = "geonode_mapstore_client" def ready(self): - run_setup_hooks() + if not apps.ready: + run_setup_hooks() super(AppConfig, self).ready() diff --git a/mapstore2_adapter/api/urls.py b/mapstore2_adapter/api/urls.py index ae51a72305..b97c73ab63 100644 --- a/mapstore2_adapter/api/urls.py +++ b/mapstore2_adapter/api/urls.py @@ -18,6 +18,5 @@ router.register(r'resources', views.MapStoreResourceViewSet, basename="resources") urlpatterns = [ - url(r'^rest/', include(router.urls)), - url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) + url(r'^rest/', include(router.urls)) ]