Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f9a2f8c

Browse files
init my_page payments
1 parent 788a3c7 commit f9a2f8c

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
hello

‎account/urls.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from django.urls import include, path
22

3-
from .views import GitHubLogin, GoogleLogin, MyPage
3+
from .views import GitHubLogin, GoogleLogin, MyPage, mypage_payments
44

55
urlpatterns = [
66
path("auth/", include("dj_rest_auth.urls")),
77
path("auth/github/login/", GitHubLogin.as_view(), name="github_login"),
88
path("auth/google/login/", GoogleLogin.as_view(), name="google_login"),
9-
path("my-page/payments", MyPage.as_view())
9+
#path("my-page/payments", MyPage.as_view())
10+
path("my-page/payments/", mypage_payments)
1011
]

‎account/views.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from allauth.socialaccount.providers.oauth2.client import OAuth2Client
44
from dj_rest_auth.registration.views import SocialLoginView
55
from django.conf import settings
6-
6+
from django.contrib.auth.decorators import login_required
7+
from django.shortcuts import render
78
from rest_framework.views import APIView
89

910

@@ -19,4 +20,8 @@ class GoogleLogin(SocialLoginView):
1920
client_class = OAuth2Client
2021

2122
class MyPage(APIView):
22-
pass
23+
pass
24+
25+
@login_required
26+
def mypage_payments(request):
27+
return render(request, 'account_mypage_payments.html')

‎pyconkr/settings.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@
8080
TEMPLATES = [
8181
{
8282
"BACKEND": "django.template.backends.django.DjangoTemplates",
83-
"DIRS": [BASE_DIR / "templates"],
83+
"DIRS": [BASE_DIR / "templates" ,
84+
BASE_DIR / "account/templates",
85+
],
8486
"APP_DIRS": True,
8587
"OPTIONS": {
8688
"context_processors": [

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /