From 13be151548006c572e7f59ace593b90fa3fa02d5 Mon Sep 17 00:00:00 2001 From: afabiani Date: Wed, 21 Jul 2021 09:50:32 +0200 Subject: [PATCH] [FIXES #344] Real Cause of 'rest_framework namespace is not Unique' is not Fixed --- geonode_mapstore_client/apps.py | 5 +++-- mapstore2_adapter/api/urls.py | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/geonode_mapstore_client/apps.py b/geonode_mapstore_client/apps.py index ff8163106d..68b76c53ce 100644 --- a/geonode_mapstore_client/apps.py +++ b/geonode_mapstore_client/apps.py @@ -9,7 +9,7 @@ # ######################################################################### import os -from django.apps import AppConfig as BaseAppConfig +from django.apps import apps, AppConfig as BaseAppConfig from django.views.generic import TemplateView def run_setup_hooks(*args, **kwargs): @@ -33,5 +33,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 b3c13d2d4e..e9e849592c 100644 --- a/mapstore2_adapter/api/urls.py +++ b/mapstore2_adapter/api/urls.py @@ -9,13 +9,10 @@ # ######################################################################### -from django.conf.urls import url, include from rest_framework import routers from . import views router = routers.DefaultRouter() router.register(r'users', views.UserViewSet) -urlpatterns = [ - url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) -] +urlpatterns = []