Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rest_framework namespace and duplicate URLs #344

Closed
asgharsir opened this issue Jul 19, 2021 · 0 comments
Closed

rest_framework namespace and duplicate URLs #344

asgharsir opened this issue Jul 19, 2021 · 0 comments

Comments

@asgharsir
Copy link

asgharsir commented Jul 19, 2021

Issue started with seeing this:
image

This we see when we use geonode 3.2.x or 3.3.x, but this was not appearing while using the master. I investigated what is different in the master. I found that the issue is related to geonode-mapstore-client, and the genode master is installing the latest/recommended version while, geonode 3.2.x for example, is installing version 3.2.1 of django-geonode-mapstore-client.

But there is no fix in the recommended version also. mapstore2_adapter url patterns are part of app config, which is not working for the mapstore/rest. Those URLs are not there in master branch. In 3.2.x there is an additional problem. The mapstore/rest/ urls are all duplicated:
image
Above we can see that all the urls are actually duplicate. This can expose to us, or already exposing to us, to unexpected bugs.

  • Also, we could decide do we really need rest_framework.urls, in the first place? Because mapstore-client is supposed to be integrated into geonode apps which is already having this. But even if we needed it, a best practice could be to avoid this common name: rest_framework.
  • But actually I changed this common name, and still there was the problem. Because that was not the cause of the problem.
  • And in master branch although we are not having namespace is not unique warning anymore, but we are not having mapstore/rest/ urls either.

Actual Behaviour

  • Apps using current versions of geonode are seeing: ?: (urls.W005) URL namespace 'rest_framework' isn't unique. You may not be able to reverse all URLs in this namespace.
  • There are duplicate mapstore/rest urls.

Expected Behaviour

No violation of unique namespace, specially for our APIs.
No duplicate URLs.

I think the fix is not in not using the namespace, rather it is the realization of the problem. The solution is maybe in fixing the app's configuration module.

@asgharsir asgharsir changed the title Real Cause of rest_framework namespace is not fixed Real Cause of "rest_framework namespace is not Unique" is not fixed Jul 19, 2021
@asgharsir asgharsir changed the title Real Cause of "rest_framework namespace is not Unique" is not fixed rest_framework namespace and duplicate URLs Jul 20, 2021
afabiani pushed a commit that referenced this issue Jul 21, 2021
…s not Fixed (#345)

* [FIXES #344] Real Cause of 'rest_framework namespace is not Unique' is not fixed

* added a comment

* removed rest_framework.urls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant