Skip to content

Commit

Permalink
feat: update site metadata (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna authored Oct 1, 2023
1 parent 14ab22b commit f74ddb5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 36 deletions.
27 changes: 0 additions & 27 deletions basedosdados_api/core/templates/core/home.html

This file was deleted.

2 changes: 2 additions & 0 deletions basedosdados_api/core/templates/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-Agent: *
Disallow: /admin
20 changes: 11 additions & 9 deletions basedosdados_api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@
from django.http import HttpResponseRedirect
from django.urls import include, path, re_path
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base import TemplateView
from graphene_file_upload.django import FileUploadGraphQLView

from basedosdados_api.api.v1.views import DatasetESSearchView


def home_redirect(request):
return HttpResponseRedirect("/api")


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

Expand All @@ -37,20 +34,25 @@ def redirect_to_v1_graphql(request):
return HttpResponseRedirect("/api/v1/graphql")


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


urlpatterns = [
re_path(r"^healthcheck/", include("health_check.urls")),
path("admin/", admin.site.urls),
path("martor/", include("martor.urls")),
path("account/", include("basedosdados_api.account.urls")),
re_path(r"^healthcheck/", include("health_check.urls")),
path("api/", redirect_to_v1, name="api"),
path("api/v1/", redirect_to_v1_graphql),
path(
"api/v1/graphql",
csrf_exempt(FileUploadGraphQLView.as_view(graphiql=True)),
name="graphiql",
),
path("schemas/", include("basedosdados_api.schemas.urls")),
path("", include("basedosdados_api.core.urls")),
path("search/", DatasetESSearchView.as_view(), name="search_view"),
path("busca/", include("haystack.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
path("search/", DatasetESSearchView.as_view()),
path("search/debug/", include("haystack.urls")),
path("robots.txt", render_robots()),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

0 comments on commit f74ddb5

Please sign in to comment.