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

main to side #54

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
SetStudentAttView,
SetTeacherAttView,
test,
test2,
MailTestView,
UnsetStudentAttView,
genAdmin,
Expand All @@ -52,6 +53,7 @@

urlpatterns = [
path('test', test),
path('test2', test2),
path('send_welcome_email', MailTestView.as_view(), name='send_welcome_email'),
path('genadmin', genAdmin),

Expand Down
22 changes: 22 additions & 0 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ def test(request):
"""
return Response({"ping": "pong"}, 200)

@extend_schema(
methods=['GET'], # Specify methods if @api_view is not used, otherwise redundant
summary="Ping Pong 2",
description="Returns a simple ping to a pong2 response.",
responses={
status.HTTP_200_OK: OpenApiResponse(description="Success - Returns a ping pong2 response."),
# Add more status codes as needed
}
)
@api_view(['GET'])
def test2(request):
"""
A simple API endpoint that responds with a 'pong2' to a 'ping' request.

Args:
request (Request): The request object.

Returns:
Response: A JSON response containing {"ping": "pong2"}.
"""
return Response({"ping": "pong2"}, 200)

@extend_schema(
summary="Send Test Email",
description="Tries to send a test email.",
Expand Down
Loading