Skip to content

Commit

Permalink
chore: update urls
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna committed Mar 27, 2024
1 parent 772a1ff commit 46aef4f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 35 deletions.
6 changes: 3 additions & 3 deletions bd_api/apps/account_auth/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from . import views

urlpatterns = [
path("", views.auth, name="auth"),
path("login/", views.signin, name="login"),
path("logout/", views.signout, name="logout"),
path("auth/", views.auth, name="auth"),
path("auth/login/", views.signin, name="login"),
path("auth/logout/", views.signout, name="logout"),
]
2 changes: 1 addition & 1 deletion bd_api/apps/account_payment/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
from django.urls import include, path

urlpatterns = [path("", include("djstripe.urls", namespace="payment"))]
urlpatterns = [path("payment/", include("djstripe.urls", namespace="payment"))]
24 changes: 14 additions & 10 deletions bd_api/apps/api/v1/urls.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# -*- coding: utf-8 -*-
from django.http import HttpResponseRedirect
from django.urls import path
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt
from graphene_file_upload.django import FileUploadGraphQLView

from bd_api.apps.api.v1.search_views import DatasetSearchView
from bd_api.apps.api.v1.views import DatasetRedirectView


def redirect_to_v1(request):
return HttpResponseRedirect("/api/v1/")
return HttpResponseRedirect("/api/v1/graphql")


def redirect_to_v1_graphql(request):
return HttpResponseRedirect("/api/v1/graphql")
def graphql_view():
return csrf_exempt(FileUploadGraphQLView.as_view(graphiql=True))


urlpatterns = [
path("", redirect_to_v1),
path("v1/", redirect_to_v1_graphql),
path(
"v1/graphql",
csrf_exempt(FileUploadGraphQLView.as_view(graphiql=True)),
),
path("api/", redirect_to_v1),
path("api/v1/", redirect_to_v1),
path("api/v1/graphql", graphql_view()),
path("search/", DatasetSearchView.as_view()),
path("search/debug/", include("haystack.urls")),
path("dataset/", DatasetRedirectView.as_view()),
path("dataset_redirect/", DatasetRedirectView.as_view()),
]
25 changes: 4 additions & 21 deletions bd_api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,13 @@
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt
from graphene_file_upload.django import FileUploadGraphQLView

from bd_api.apps.api.v1.search_views import DatasetSearchView as DatasetSearchV2View
from bd_api.apps.api.v1.views import DatasetRedirectView
from bd_api.apps.api.v1.views import DatasetSearchView as DatasetSearchV1View


def graphql_view():
return csrf_exempt(FileUploadGraphQLView.as_view(graphiql=True))


urlpatterns = [
path("admin/", admin.site.urls),
path("", include("bd_api.apps.core.urls")),
path("api/", include("bd_api.apps.api.v1.urls")),
path("api/graphql/", graphql_view()),
path("account/", include("bd_api.apps.account.urls")),
path("auth/", include("bd_api.apps.account_auth.urls")),
path("search/", DatasetSearchV1View.as_view()),
path("search/v2/", DatasetSearchV2View.as_view()),
path("search/debug/", include("haystack.urls")),
path("dataset/", DatasetRedirectView.as_view()),
path("dataset_redirect/", DatasetRedirectView.as_view()),
path("payment/", include("bd_api.apps.account_payment.urls")),
path("", include("bd_api.apps.api.v1.urls")),
path("", include("bd_api.apps.account.urls")),
path("", include("bd_api.apps.account_auth.urls")),
path("", include("bd_api.apps.account_payment.urls")),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

0 comments on commit 46aef4f

Please sign in to comment.