Skip to content

Commit

Permalink
Remove graphiql url from debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sudan45 committed Dec 11, 2024
1 parent 679ba26 commit b5f1b8d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,24 @@
from django.urls import path
from django.views.decorators.csrf import csrf_exempt

from content.views import UserQuery
from main.graphql.schema import CustomAsyncGraphQLView
from main.graphql.schema import schema as graphql_schema

from content.views import UserQuery

urlpatterns = [
path("admin/", admin.site.urls),
path("chat_message", UserQuery.as_view()),
path("graphiql/", csrf_exempt(CustomAsyncGraphQLView.as_view(schema=graphql_schema))),
path(
"graphql/",
CustomAsyncGraphQLView.as_view(
schema=graphql_schema,
graphiql=False,
),
),
]
if settings.DEBUG:
urlpatterns.append(path("graphiql/", csrf_exempt(CustomAsyncGraphQLView.as_view(schema=graphql_schema))))

# Static and media file URLs
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Expand Down

0 comments on commit b5f1b8d

Please sign in to comment.