Skip to content

Commit

Permalink
feat: move utils views to core app (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna authored Oct 28, 2023
1 parent 9f3a470 commit 24687fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
14 changes: 11 additions & 3 deletions bd_api/apps/core/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from django.urls import path
from django.views.generic import RedirectView
from django.urls import include, path, re_path
from django.views.generic import RedirectView, TemplateView

from bd_api.apps.core.views import (
DatasetCreateView,
Expand All @@ -9,8 +9,16 @@
DatasetUpdateView,
)


def render_robots():
return TemplateView.as_view(template_name="robots.txt", content_type="text/plain")


urlpatterns = [
path("", RedirectView.as_view(url="admin", permanent=True)),
path("robots.txt", render_robots()),
re_path(r"^healthcheck/", include("health_check.urls")),
path("", RedirectView.as_view(url="admin", permanent=True), name="home"),
#
path("dataset/", DatasetCreateView.as_view(), name="dataset"),
path("dataset_redirect/", DatasetRedirectView.as_view(), name="dataset_redirect"),
path("dataset/<uuid:pk>/", DatasetUpdateView.as_view(), name="dataset_detail"),
Expand Down
3 changes: 1 addition & 2 deletions bd_api/apps/core/views/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

from .dataset_redirect import DatasetRedirectView # noqa: F401
from .dataset_views import DatasetCreateView # noqa: F401
from .dataset_views import DatasetDeleteView, DatasetUpdateView # noqa: F401
from .dataset_views import DatasetCreateView, DatasetDeleteView, DatasetUpdateView # noqa: F401
15 changes: 2 additions & 13 deletions bd_api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,15 @@
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path, re_path
from django.views.generic.base import TemplateView
from django.urls import include, path

from bd_api.apps.api.v1.views import DatasetESSearchView


def render_robots():
return TemplateView.as_view(template_name="robots.txt", content_type="text/plain")


urlpatterns = [
# Meta
path("robots.txt", render_robots()),
re_path(r"^healthcheck/", include("health_check.urls")),
# Admin
path("admin/", admin.site.urls),
# Applications
path("", include("bd_api.apps.core.urls")),
path("account/", include("bd_api.apps.account.urls")),
path("api/", include("bd_api.apps.api.v1.urls")),
path("account/", include("bd_api.apps.account.urls")),
path("search/", DatasetESSearchView.as_view()),
path("search/debug/", include("haystack.urls")),
path("payment/", include("bd_api.apps.payment.urls")),
Expand Down

0 comments on commit 24687fe

Please sign in to comment.