Skip to content

Commit

Permalink
Merge pull request #84 from jjyyhh0208/code-review
Browse files Browse the repository at this point in the history
Feat: OPENAI API KEY added
jjyyhh0208 authored Oct 20, 2024

Unverified

The committer email address is not verified.
2 parents 62cbcbf + 5ca3ff6 commit 2161542
Showing 6 changed files with 37 additions and 5 deletions.
Binary file modified backend/worklog/profiles/__pycache__/serializers.cpython-311.pyc
Binary file not shown.
Binary file modified backend/worklog/profiles/__pycache__/views.cpython-311.pyc
Binary file not shown.
25 changes: 25 additions & 0 deletions backend/worklog/profiles/migrations/0002_alter_feedback_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 5.0.6 on 2024-10-20 04:17

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("profiles", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name="feedback",
name="user",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="feedbacks_of",
to=settings.AUTH_USER_MODEL,
),
),
]
11 changes: 7 additions & 4 deletions backend/worklog/profiles/urls.py
Original file line number Diff line number Diff line change
@@ -5,12 +5,12 @@
UserProfileView, UserWorkStyleView, UserInterestView,
UserNameFeedbackStyleView, WorkStyleView, InterestView, ShortQuestionView, LongQuestionViewSet,
FeedbackViewSet, UserLongQuestionView, UserFriendView,
UserCurrentProfileView, UserSearchView, UserLongQuestionAnswersView,
TestAnswers, FollowFriendView,
ProfileImageView, get_signed_url_view, TestAnswers,
UserCurrentProfileView, UserSearchView, UserLongQuestionAnswersView, FollowFriendView,
ProfileImageView, get_signed_url_view,
FollowFriendView, UnfollowFriendView, UpdateBioView,
# google_callback, google_login, GoogleLogin
KakaoLoginCallback, get_token
KakaoLoginCallback, get_token,
TestAPIKey
)


@@ -53,4 +53,7 @@

#그 외
path('user/get-signed-url/<path:image_path>/', get_signed_url_view, name='get_signed_url'), # s3 인증값을 받는 엔드포인트

#api key test
path('test/', TestAPIKey.as_view(), name='keytest'),
]
6 changes: 5 additions & 1 deletion backend/worklog/profiles/views.py
Original file line number Diff line number Diff line change
@@ -933,4 +933,8 @@ def get_token(request):
except jwt.ExpiredSignatureError:
return redirect(next_url)
except jwt.InvalidTokenError:
return redirect(next_url)
return redirect(next_url)

class TestAPIKey(APIView):
def get(self, request):
return Response({"api_key": settings.OPENAI_API_KEY})
Binary file modified backend/worklog/worklog/__pycache__/settings.cpython-311.pyc
Binary file not shown.

0 comments on commit 2161542

Please sign in to comment.