code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,10 @@
+from django.urls import path
+from .views import SignupView, LoginView, FollowView
+
+urlpatterns = [
+ path('/user', SignupView.as_view()),
+ path('/login', LoginView.as_view()),
+ path('/follow', FollowView.as_view()),
+
+]
+'''Error๊ฐ ์๋๋ผ django์ ๊ถ์ฅ์ฌํญ. ํ์ง๋ง ํจํด ์ปจ๋ฒค์
์๋ ์ ์ฌํญ์ด ๋ง๋ค.''' | Python | import ํ์ค ๋ `*` ์ฌ์ฉํ์ง ๋ง์๊ณ ๋ช
ํํ๊ฒ ๊ฐ์ ธ์ค๊ณ ์ถ์ class ๋ฅผ ์ ์ด์ฃผ์ธ์! |
@@ -0,0 +1,10 @@
+from django.urls import path
+from .views import SignupView, LoginView, FollowView
+
+urlpatterns = [
+ path('/user', SignupView.as_view()),
+ path('/login', LoginView.as_view()),
+ path('/follow', FollowView.as_view()),
+
+]
+'''Error๊ฐ ์๋๋ผ django์ ๊ถ์ฅ์ฌํญ. ํ์ง๋ง ํจํด ์ปจ๋ฒค์
์๋ ์ ์ฌํญ์ด ๋ง๋ค.''' | Python | ์ด ๋ถ๋ถ ์ธ์
์ค ํ๋ฒ ์ค๋ช
๋๋ ธ๋๋ฐ, ์ `/` ๊ด๋ จ warning ์ด ๋ฌ๋ค๊ณ ์๊ฐํ์๋์!? |
@@ -0,0 +1,21 @@
+"""westagram URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+ https://docs.djangoproject.com/en/3.1/topics/http/urls/
+Examples:
+Function views
+ 1. Add an import: from my_app import views
+ 2. Add a URL to urlpatterns: path('', views.hom... | Python | ์ด ๋ถ๋ถ์ ์์ฝ๋ url ํจํด ์ปจ๋ฒค์
์ ๋ง์ง ์์ต๋๋ค. ์์ ๋ฆฌ๋ทฐ๋๋ฆฐ ๋ด์ฉ ์ค `/` ๊ด๋ จ ์ง๋ฌธ ๋จ๊ฒจ๋๋ ธ์ผ๋ ํ์ธํด์ฃผ์ธ์. |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ๊น๋ํ๋ค์~! ๐ฏ |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | `json.loads()` ๋ ํธ๋คํด์ฃผ์
์ผํ๋ exception ์ด ๋ฐ์ํ ์ ์์ต๋๋ค. ํ์ธํด๋ณด์๊ณ ์ถ๊ฐํด์ฃผ์ธ์! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ๋ค๋ฏผ๋์ด ์์ฑํ์ ์ฝ๋ ๋ก์ง์ ์์๋๋ก ์ ๋ฆฌํด๋ณด๊ฒ ์ต๋๋ค.
1. `client` ์์ ๋ค์ด์จ `email`, `password` ๊ฐ์ ์ด์ฉํ์ฌ ์ผ์นํ๋ user ๋ฅผ filter ํ๋ ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ ค user ๋ณ์์ ์ ์ฅํด์ค๋ค.
2. `email` ๋ก filter ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ ค ์กด์ฌํ๋ user ์ธ์ง ํ์ธํ๋ค.
3. `password` ๋ก filter ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ ค ์กด์ฌํ๋ user ์ธ์ง ํ์ธํ๋ค.
4. client ์์ ๋ค์ด์จ `email`, `password` ๊ฐ ์ ํจํ ํฌ๋งท์ธ์ง ๊ฒ์ฌํ์ฌ ์ ํจํ๋ค๋ฉด CREATE ๋ฅผ ์งํํ๋ค.
์ด๋ ๊ฒ ๋ง๋ก ์ ๋ฆฌํด๋ณด๋ ํ๋ฆ์ด ์ข ์ด... |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ์ฌ๊ธฐ์ ์ ๊น ์ง๋ฌธ!
`KeyError` ์ด๋ค ์๋ฌ์ด๋ฉฐ, ์ธ์ ๋ฐ์ํ ๊น์? |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | SignupView ์ ๋น์ทํ ๋ก์ง ํ๋ฆ์ด๋ค์. ์์ชฝ ๋จ๊ฒจ๋๋ฆฐ ์ง๋ฌธ ๋จผ์ ํ์ธํด์ฃผ์ธ์! |
@@ -0,0 +1,17 @@
+from django.db import models
+
+class User(models.Model):
+ email = models.EmailField(max_length=50, unique=True)
+ password = models.CharField(max_length=100)
+ relation = models.ManyToManyField('self', through='Follow', symmetrical=False)
+
+ class Meta:
+ db_table = "users"
+ ... | Python | `from django.db import models
class User(models.Model):
email = models.EmailField(max_length=50, unique=True)` ๋ก ํด๊ฒฐํ์ต๋๋ค. |
@@ -0,0 +1,10 @@
+from django.urls import path
+from .views import SignupView, LoginView, FollowView
+
+urlpatterns = [
+ path('/user', SignupView.as_view()),
+ path('/login', LoginView.as_view()),
+ path('/follow', FollowView.as_view()),
+
+]
+'''Error๊ฐ ์๋๋ผ django์ ๊ถ์ฅ์ฌํญ. ํ์ง๋ง ํจํด ์ปจ๋ฒค์
์๋ ์ ์ฌํญ์ด ๋ง๋ค.''' | Python | `from django.urls import path
from .views import SignupView, LoginView` ๋ก ํ์ํ ๋ทฐ ํด๋์ค ๊ฐ์ ธ์ค๋ ๊ฒ์ผ๋ก ์์ ํ์์ต๋๋ค. |
@@ -0,0 +1,10 @@
+from django.urls import path
+from .views import SignupView, LoginView, FollowView
+
+urlpatterns = [
+ path('/user', SignupView.as_view()),
+ path('/login', LoginView.as_view()),
+ path('/follow', FollowView.as_view()),
+
+]
+'''Error๊ฐ ์๋๋ผ django์ ๊ถ์ฅ์ฌํญ. ํ์ง๋ง ํจํด ์ปจ๋ฒค์
์๋ ์ ์ฌํญ์ด ๋ง๋ค.''' | Python | Error๊ฐ ์๋๋ผ django์ ๊ถ์ฅ์ฌํญ์ด์ด์ ๊ทธ๋ ์ต๋๋ค. ํ์ง๋ง ํจํด ์ปจ๋ฒค์
์๋ ๊ณ ์ณ์ ์ฐ๋ ๊ฒ์ด ๋ง๊ธฐ ๋๋ฌธ์ ๊ณ ์ณค์ต๋๋ค. |
@@ -0,0 +1,21 @@
+"""westagram URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+ https://docs.djangoproject.com/en/3.1/topics/http/urls/
+Examples:
+Function views
+ 1. Add an import: from my_app import views
+ 2. Add a URL to urlpatterns: path('', views.hom... | Python | ์์ ํ์์ต๋๋ค. |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | `class SignupView(View):
def post(self, request):
try:
data = json.loads(request.body)
user = User.objects.filter(email=data['email'],password=data['password'])`
์๋ ๋ก๊ทธ์ธ๋ทฐ๋ ๋๊ฐ์ ํํ๋ก ๋ฐ๊ฟจ์ต๋๋ค.
์ด์ : ์ฌ์ฉ์์๊ฒ ํ์์ ๋ฐ์ ๋ ๊ผญ ๋ด๊ฐ ์ํ๋ ํํ๋ก json์ด ์ค์ง ์์ ์ ์๊ธฐ์ Key-error ์ํฉ์ ์ค์ผ ํ๊ธฐ ๋๋ฌธ. |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ์ด๊ฑฐ ํํฅ๋ํ๊ณ ์ด์ผ๊ธฐํ๋ค๊ฐ ์ ๊ฒ์ธ๋ฐ, ํค ์๋ฌ๋ ๋์
๋๋ฆฌ ํํ์์ ์์ฃผ ๋ฐ์ํ๋ฉฐ ๋์
๋๋ฆฌ ๋ด๋ถ์ ์กด์ฌํ์ง ์๋ ํค๋ฅผ ์ฌ์ฉํด์ ๊ฐ์ ๋ด๋ ค๊ณ ํ ๋ ๋๋ ์๋ฌ์
๋๋ค. ์ด๋ฒ ์์๋ก๋ ๋ง์ผ ๋ฐ์ดํฐ๊ฐ email=~~~ password=~~~ ๋ก ์ค๋ ๊ฒ์ด ์๋๋ผ emailadkfj=~~~ apsdkfjsa=~~~์ฒ๋ผ ํค ๋ด์ฉ์ด ์๋ชป ์๋ฒ๋ฆฌ๋ ๊ฒฝ์ฐ ์์ธ ์ฒ๋ฆฌ๋ก ํค ์๋ฌ๋ฅผ ๋ด๊ธฐ ์ํด ํ๋ ๊ฒ์ผ๋ก ์๋ํ๊ณ ํ์ต๋๋ค! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ํ์ธํ์ต๋๋ค |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ๋จผ์ ๋ ํด๋์ค ๋ชจ๋ ๊ณตํต์ ์ผ๋ก user๋ผ๋ ๋ณ์๊ฐ ๋ถํ์ํด์ ์ง์ ์ต๋๋ค.
- ์ด์ : ์ด๋ฏธ User.~๋ฅผ ํตํด ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ ค ๋ฐ์ดํฐ์์ ํ์ํ ์๋ฃ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์๋ค. ๋ถํ์ํ ๋ณ์์๋ค.
- comment :
1. client์์ ๋ค์ด์จ ๊ฐ ์ค ์ด๋ฉ์ผ ํํฐ ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ ค ์กด์ฌํ๋ ์ด๋ฉ์ผ์ผ ๊ฒฝ์ฐ์ธ์ง ํ์ธ.
2. (๋ง์ฐฌ๊ฐ์ง๋ก) ๋น๋ฐ๋ฒํธ ํํฐ ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ ค ์กด์ฌํ๋ ๋น๋ฐ๋ฒํธ์ธ์ง ํ์ธ.
3. ์ด๋ฉ์ผ๊ณผ ๋น๋ฐ๋ฒํธ๊ฐ ์ ํจํ ํฌ๋งท์ธ์ง ๊ฒ์ฌํ์ฌ ์ ํจํ๋ฉด ๊ฐ ๋ง๋ค๊ธฐ ์งํ.
- ์์ง ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ฆฐ๋ค๋ ๊ฐ๋
์ด ํ์คํ ์์ง ์์ ํํ์ด ๋ง๋๊ฑด์ง๋ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ๋ฌธ๋ฒ์ ์ธ ์ ์ ๊ฒํ ํด... |
@@ -0,0 +1,17 @@
+from django.db import models
+
+class User(models.Model):
+ email = models.EmailField(max_length=50, unique=True)
+ password = models.CharField(max_length=100)
+ relation = models.ManyToManyField('self', through='Follow', symmetrical=False)
+
+ class Meta:
+ db_table = "users"
+ ... | Python | `unique=True` ๊ตณ์
๋๋ค!! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | @damin0320 ์ ํํฉ๋๋ค ๋ค๋ฏผ๋! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ๊ฐ๋
์ฑ์ ์ํด ๋ก์ง๋ณ๋ก ๋ถ๋ฆฌํด์ ๋์ด์ฐ๊ธฐ๋ก ๊ตฌ๋ถํด์ฃผ์ธ์! ์ง๊ธ์ ๋๋ฌด ๋ค ๋ถ์ด์์ด์ ์ฝ๊ธฐ๊ฐ ์ข์ ์ฝ๋๊ฐ ์๋๋๋ค ๋ค๋ฏผ๋! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | exists() ํ์ฉ gooood ๐ |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ์ด ๋ถ๋ถ์ ๋ก์ง์ด ์กฐ๊ธ ์ด์ํ๋ฐ์.
password ๋ ๊ณ ์ ๊ฐ์ด ์๋๊ณ , ๊ฐ์ password ๋ฅผ ๊ฐ์ง ์ ์ ์ ๋ณด๋ค์ด ์ถฉ๋ถํ ์กด์ฌํ ์ ์๋๋ฐ password ๋ก ํํฐ๋ฅผ ๊ฑธ์ด์ค ํ์๋ ์๋ค๊ณ ์๊ฐํฉ๋๋ค~ |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ์ํธํ ๊ณผ์ ์ ์ฉ ์ ๋ง ์ํ์
จ์ต๋๋ค! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | create() ๋ค์ save() ๋ ๋ถํ์ํฉ๋๋ค ๋ค๋ฏผ๋. ์์ ์ฃผ์ธ์! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | get() ๋ฉ์๋๋ฅผ ์ฌ์ฉํ์๋ฉด ๊ผญ ์ก์์ฃผ์
์ผํ๋ exception ๋ค์ด ์์ต๋๋ค.
์์๋ณด์๊ณ exception handling ๋ก์ง์ ์ถ๊ฐํด์ฃผ์ธ์! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ์ฌ๊ธฐ๋ ๋ง์ฐฌ๊ฐ์ง๋ก ๊ฐ๋
์ฑ์ ์ํด ๋ก์ง์ ๋ธ๋ก์ผ๋ก ๊ตฌ๋ถํ์ฌ ํ์ค์ฉ ์ถ๊ฐํด์ฃผ์ธ์! |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ์ด์ผ~ jwt ์์ฑ ๋ก์ง๊น์ง ๋๋ฌด ์ ์ ์ฉํ์
จ๋ค์!
ํ์ง๋ง ์์ฑ์ ์๋ฃํ๋๋ฐ ์์ฑ๋งํ๊ณ ์ฌ์ฉ์ ์ํ๊ณ ๊ณ์๋ค์. ๋ค์ ์คํ
์ ๋ฌด์์ผ๊น์? |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ์ฌ๊ธฐ์ ์ด๋ ๊ฒ else ๋ก ์ก์์ฃผ์๊ธฐ ๋ณด๋ค๋ checkpw() ์ ๊ฐ์ด Falsy ํ๋ค๋ฉด 401 ์ ๋ฆฌํดํด์ฃผ์๊ณ ,
๋์ด์์ ์ง๊ธ ์์ ๋ณด์๋ If ๋ฌธ์ ๋ก์ง์ ์ฒ๋ฆฌํด์ฃผ์ ๋ค๋ฉด ๋ถํ์ํ else ๋ฌธ์ด ์์ด์ง๊ฒ ์ฃ ? |
@@ -0,0 +1,103 @@
+import json
+import bcrypt
+import jwt
+
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User, Follow
+from my_settings import SECRET_KEY
+
+class SignupView(View):
+ def post(self, request):
+ try:
+ data = json.loads(request.body... | Python | ํ ํฐ์์ ์ ์ ์ ๋ณด๋ฅผ ์ฐพ์์์ ํํฐํ๋ ๊ธฐ๋ฅ๊น์ง! ๐ ๐ ๐
๋ค๋ฏผ๋ ์ฒ์์๋ ์ดํดํ๋๋ฐ ์ด๋ ค์ํ์๋ ๊ฒ ๊ฐ์ ๊ฑฑ์ ์ ์กฐ๊ธ ํ์๋๋ฐ, ์ง๊ธ๋ณด๋ฉด ๋ฌธ์ ํด๊ฒฐ๋ฅ๋ ฅ์ด ์ ๋ง ์ข์ผ์ ๊ฒ ๊ฐ์์! ๋๋ฌด ์ํ์
จ์ต๋๋คใ
ใ
|
@@ -0,0 +1,145 @@
+"""
+Django settings for westagram project.
+
+Generated by 'django-admin startproject' using Django 3.1.7.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/3.1/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/3.1/r... | Python | ์๋ฒฝํฉ๋๋ค ๊ตญํ๋! ๐ฏ |
@@ -0,0 +1,145 @@
+"""
+Django settings for westagram project.
+
+Generated by 'django-admin startproject' using Django 3.1.7.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/3.1/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/3.1/r... | Python | ๋ต๋ต ํ์ธ ๊ฐ์ฌ๋๋ฆฝ๋๋ค ์นํ๋ ใ
ใ
๐๐
๋ฏธ์
2 ์งํํ๊ฒ ์ต๋๋ค~~~!!๐จโ๐ป |
@@ -0,0 +1,12 @@
+from django.db import models
+
+class User(models.Model):
+ email = models.EmailField(max_length=50, unique=True)
+ phone = models.CharField(max_length=11, null=True, unique=True)
+ full_name = models.CharField(max_length=40, null=True)
+ user_name = models.CharFiel... | Python | ๋ถํ์ํ ์ฃผ์ ์์ ์ฃผ์ธ์! |
@@ -0,0 +1,12 @@
+from django.db import models
+
+class User(models.Model):
+ email = models.EmailField(max_length=50, unique=True)
+ phone = models.CharField(max_length=11, null=True, unique=True)
+ full_name = models.CharField(max_length=40, null=True)
+ user_name = models.CharFiel... | Python | ์์ฑํ์ ์ฌ๋ฌ๊ฐ์ง ํ๋๋ค ์ค ์ค๋ณต์ ํ์ฉํ๋ฉด ์๋๋ ํ๋๋ค์ด ๋ณด์ด๋๋ฐ ๊ทธ๋ด๋ ์ฌ์ฉํ ์ ์๋ ์ต์
์ด ์์ต๋๋ค!
์ฐพ์์ ์ถ๊ฐํด์ฃผ์ธ์ ๐ |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ๊น๋ํฉ๋๋ค!! ๐ฏ ๐ฏ ๐ฏ |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ํ์ํ๋, `NULL` ํ์ฉํ๋์ ๋ฐ๋ฅธ ์ ๊ทผ ๋ฐฉ์ ๋ค๋ฅด๊ฒ ์ ์ฉ ์ํ์
จ์ต๋๋ค!! ๐๐๐
๊ฐ๋
์ฑ์ ์ํด ์กฐ๊ธ ์์น๋ฅผ ๋ณ๊ฒฝํ ์ ์๊ฒ ๋ค์! ์๋์ ๊ฐ์ด์ใ
ใ
```suggestion
email = data['email']
password = data['password']
phone = data.get('phone', None)
full_name = data.get('full_name', None)
use... |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์
๋ ฅ๋ฐ์ ํฐ๋ฒํธ์ `-` ๊ฐ ํฌํจ๋์ด ๋ค์ด์ฌ ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ฃ๊ณ ์ถ์ ํ์์ ๋ง์ถฐ์ฃผ์๋ ๋ก์ง ์ข์ต๋๋ค!
์์ผ๋ก ํ๋ก ํธ์๋๋ถ๋ค๊ณผ ํ์
์ ํ๋ฉด์ ๊ฒฝํํ์๊ฒ ์ง๋ง, ์ด๋ฐ ๋ถ๋ถ์ ๊ผญ ํ๋ก ํธ/๋ฐฑ ๊ฐ์ ์์๊ฐ ํ์ํฉ๋๋ค.
์ด ์ ์ธ์งํด์ฃผ์๊ณ ๋ค์ ์ฃผ ํ/๋ฐฑ ํต์ ๋ค์ด๊ฐ์๋ฉด ๋์์ด ๋์ค๊ฑฐ์์! ใ
ใ
|
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์ ๊ทํํ์์ผ๋ก email ๊ณผ password validate ํด์ฃผ์๋ ๋ก์ง์ธ๋ฐ ์กฐ๊ธ ์์ํ๊ฒ ๋๋์ด์ ๋น๊ตํ์๋ ค๋ค๋ณด๋ ์กฐ๊ธ ๋ณต์กํด๋ณด์ด๋ค์!
์ฐจ๋ผ๋ฆฌ ์ด๋ฉ์ผ ํ์์ ๋ง๋ ์ ๊ทํํ์์ ํต์งธ๋ก ๊ฐ์ ธ์ ์ ์ฅํด๋๊ณ `re.match()` ๋ฅผ ํ์ฉํ์ฌ ํ๋ฒ์ ํ์ธํ ์ ์์ต๋๋ค. `password` ๋ ๋ง์ฐฌ๊ฐ์ง๊ตฌ์!
๊ทธ๋ ๊ฒ ๋ณ๊ฒฝํด์ฃผ์๋ฉด ์กฐ๊ธ ๋ ๊น๋ํ ์กฐ๊ฑด๋ฌธ์ ๋ง๋ค ์ ์์ต๋๋ค ๐ |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์ด๋ฏธ ์กด์ฌํ๋ ์ ๋ณด์ธ์ง ํ์ธํ๋ ๋ก์ง์ ์์ฑํด์ฃผ์
จ๋๋ฐ ์์ฑํด์ฃผ์ ๋ก์ง์ ํ๋ฆ๋๋ก ๊ธ๋ก ์ ๋ฆฌํด๋ณด๊ฒ ์ต๋๋ค.
1. ์
๋ ฅ๋ฐ์ `email` ๊ฐ์ผ๋ก ์ ์ ํ
์ด๋ธ์ filter ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ ค ๋ฐํ๋ฐ์ QuerySet ๋ฆฌ์คํธ์ ๊ฐ์ฒด๊ฐ ์กด์ฌํ์ง ์๋๋ค๋ฉด `phone_number` ๊ณผ `user_name` ์ผ๋ก filter ์ฟผ๋ฆฌ๋ฅผ ๋ ๋ ค ์ถ๊ฐ ํ์ธ์ ํ๋ค.
2. ์กด์ฌํ๋ค๋ฉด `400` ์ ๋ฆฌํดํด์ค๋ค.
ํ์ง๋ง ํ์ฌ `SignUp` View ์์๋ `email` ์ ํ์๊ฐ์ผ๋ก ๋ฐ์์ผํ๊ธฐ ๋๋ฌธ์ ์ฌ์ค์ `email` ์กด์ฌ ์ ๋ฌด๋ง ํ์ธํด๋ ๋ฑ๋ก๋ ์ ์ ์ธ์ง ์๋์ง๋ ์ ์๊ฐ ์์ต๋๋ค. ... |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ๊น๋ํฉ๋๋ค~ ๐ฏ |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ๊ตฌ๋ถ์ ์ํด ์์๋๋ก ํ์ค์ฉ ์ถ๊ฐํด์ฃผ์๋ฉด ๊ฐ๋
์ฑ์ด ๋ ์ข์์ง๊ฒ ๋ค์! ๐ |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์ด๋ฐ์์ผ๋ก exception ์ ์ฒ๋ฆฌํ์๊ฒ ๋๋ฉด ์ด๋ค exception ์ด ๋ฌด์๋๋ฌธ์ `raise` ๋์๋์ง ํ์ธํ๊ธฐ๊ฐ ์ด๋ ต์ต๋๋ค. ๊ทธ๋์ exception ํธ๋ค๋ฌ ์ถ๊ฐํด์ฃผ์ค๋๋ ์์์ `KeyError` ์ฒ๋ฆฌํด์ฃผ์ ๊ฒ๊ณผ ๊ฐ์ด ๋ช
ํํ๊ฒ ์ง์ ํ์ฌ ์ฒ๋ฆฌํด์ฃผ์
์ผํฉ๋๋ค.
ํ์ง๋ง ์ง๊ธ ๋จ๊ณ์์ ์ด๋ค exception ์ด ๋ฐ์ํ ์ ์๋์ง ๋ชจ๋ฅด๋๊ฒ ๋น์ฐํ๊ธฐ ๋๋ฌธ์ ์ด๋ด๋๋ ๊ทธ๋ฅ ์ฌ๋ฌ๊ฐ์ง ๋ฐฉ๋ฒ์ผ๋ก ํธ์ถํด๋ณด๋ฉด์ ๊ฒฝํํ์ฌ ์ถ๊ฐํด์ฃผ์๋ค๋ณด๋ฉด ๋์ค์๋ ๋ฉ์๋ ํ๋๋ฅผ ์ถ๊ฐํ ๋ ๊ด๋ จํ exception ์ ์ฒ๋ฆฌํด์ฃผ๋ ๋ก์ง์ ๋ฐ๋ก ํจ๊ป ์์ฑํ ์ ์๊ฒ ๋์ค๊ฑฐ์์! ๐ |
@@ -0,0 +1,12 @@
+from django.db import models
+
+class User(models.Model):
+ email = models.EmailField(max_length=50, unique=True)
+ phone = models.CharField(max_length=11, null=True, unique=True)
+ full_name = models.CharField(max_length=40, null=True)
+ user_name = models.CharFiel... | Python | ๋ค๋ต!! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์ํ ๋ค๋ต!! ๊ถ๊ธํ ์ ํด๊ฒฐ ๋์์ต๋๋ค ใ
ใ
!! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์นํ๋, ๋ง์ํ์ ๋๋ก, ์ด๋ฉ์ผ ์ฃผ์์ ๋น๋ฐ๋ฒํธ ์ ๊ท์ ๊ฒ์ฌ์ ํ์ํ ๊ฐ์ REGEX_EMAIL, REGEX_PASSWORD์๋ค๊ฐ ์ ์ฅํ์ฌ ํ์ฉํ์์ต๋๋ค..! ๋ณด๋ค ์ฝ๋๊ฐ ๊ฐ๊ฒฐํด์ ธ์ ์์ฃผ ์ข๋ค์ ใ
ใ
ใ
|
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์นํ๋, ์๊น ํด์ฃผ์ ๋ง์ ๋ฃ๊ณ User ํด๋์ค์ ํน์ ์ปฌ๋ผ์ ๊ณ ์ ํ ๊ฐ์ ๊ฐ์ง๋๋ก unique ์ต์
์ ์ค์ ํ์์ต๋๋ค..! ๊ทธ๋ฆฌ๊ณ ๋ง์ํด์ฃผ์ q ํด๋์ค๋ ๊ณต๋ถํ๊ณ ๋ค์ ์์ค์๋ ์ ์ฉํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค!! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | Truthy, Falsy values ์ ๋ํด ์์๋ณด์๊ณ ํด๋น ์กฐ๊ฑด๋ฌธ๋ค์ ์ด๋ป๊ฒ ๋ ๊น๋ํ๊ฒ ์ ๋ฆฌํ ์ ์์์ง ๊ณ ๋ฏผํด๋ณด์๊ณ ์ ์ฉํด์ฃผ์ธ์! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์ด์ bcrypt ๋ก ๋น๋ฐ๋ฒํธ๋ฅผ ์ํธํํ์ฌ ์ ์ฅํ๋ ๋ก์ง์ ์ถ๊ฐํด์ฃผ์ธ์! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์ฌ๊ธฐ์๋ ๋ฐ์ํ ์ ์๋ exception ์ด ์กด์ฌํฉ๋๋ค!
exception handling ๋ก์ง์ ์ถ๊ฐํด์ฃผ์ธ์!! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | `=` ๊ธฐ์ค ๊ฐ๊ฒฉ ์ ๋ ฌํด์ฃผ์ธ์ ๊ตญํ๋! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | - `|` ์ฌ์ด ๊ฐ๊ฒฉ๋ ํต์ผํด์ฃผ์ธ์~
- ์ด ๋ถ๋ถ ๋ก์ง์ด ์ดํด๊ฐ ์ ์๋๋๋ฐ ์ ๋ถ user_id ๋ฅผ ๋์
ํ์ฌ ํ์ธํ๊ณ ์ถ์๊ฒ ๋ง์ผ์ ๊ฐ์?! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ๋ต๋ต!! ์์ ํด๋ณด๊ฒ ์ต๋๋ค~~ |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ๋ต ์นํ๋!
์ ๋ ์ฌ์ฉ์๊ฐ ๋ก๊ทธ์ธํ ๋ ์ด๋ฉ์ผ, ํด๋ํฐ, ์ ์ ๋ค์ ์ด ์ธ๊ฐ์ค์ ํ๋๋ก ๋ก๊ทธ์ธํ ๊บผ๋ผ๊ณ ์๊ฐ์ ํด์ ์ฌ์ฉ์๊ฐ ์
๋ ฅํ ๊ฐ์ ์์ user_id๋ก ๊ฐ์ ๋ฐ์ผ๋ ค ํ์ต๋๋ค..! ๊ทธ๋์ ์ด user_id๊ฐ์ ๊ฐ์ง๊ณ ํ๋๋ผ๋ ์ด๋ฉ์ผ, ํด๋ํฐ, ์ ์ ๋ค์๊ณผ ๊ฐ์๊ฒ ์์ผ๋ฉด ์ ํจํ ์์ด๋๊ฐ์ด๋ผ๊ณ ์๊ฐํ์์ต๋๋ค..! |
@@ -0,0 +1,87 @@
+import re, json, bcrypt
+
+from django.views import View
+from django.http import JsonResponse, request
+from django.db.models.query_utils import Q
+from json.decoder import JSONDecodeError
+
+from user.utils import LoginCheck
+from user.models import ... | Python | ์นํ๋ ํน์ json ๊ด๋ จ exception ์ด JSONDecodeError ์ธ๊ฒ์ผ๊น์..? |
@@ -0,0 +1,12 @@
+from django.db import models
+
+class User(models.Model):
+
+ email = models.EmailField(max_length=50, unique=True)
+ name = models.CharField(max_length=50, unique=True)
+ phone = models.CharField(max_length=50, unique=True)
+ password= models.CharField(max_length=500)
+
+ class... | Python | - email ์ ๊ฐ๋
์ฑ์ ์ํด, ๊ทธ๋ฆฌ๊ณ ์ถํ ์ฅ๊ณ Form ์ด ์ ๊ณตํ๋ validator ๋ฅผ ์ฌ์ฉํ ์๋ ์์ ๊ฒ์ ๊ฐ์ํด์ EmailField ๋ก ์ ์ธํด์ฃผ์ธ์!
- ๊ทธ๋ฆฌ๊ณ email ์ ๊ณ ์ ๊ฐ์ด์ฃ ? ์ด๋ด๋ ์ถ๊ฐํด์ค ์ ์๋ ์ต์
์ด ์์ต๋๋ค! ์ฐพ์์ ์ถ๊ฐํด์ฃผ์ธ์~ |
@@ -0,0 +1,12 @@
+from django.db import models
+
+class User(models.Model):
+
+ email = models.EmailField(max_length=50, unique=True)
+ name = models.CharField(max_length=50, unique=True)
+ phone = models.CharField(max_length=50, unique=True)
+ password= models.CharField(max_length=500)
+
+ class... | Python | ๋ณดํต ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ปฌ๋ผ๋ช
์ ์ค์ฌ์ฐ์ง์๊ณ ์ต๋ํ ๋ช
ํํ๊ฒ ํ์ด์ ์ ์ธํด์ค๋๋ค. ์ฌ๊ธฐ๋ password ๋ก ํ์ด์ฃผ์ธ์~
๊ทธ๋ฆฌ๊ณ ์ด์ ๋น๋ฐ๋ฒํธ ์ํธํ ๊ณผ์ ์ ์งํํ๋๋งํผ ์ต๋ ๊ธ์์๋ฅผ ์กฐ๊ธ ๋ ๋๋ํ๊ฒ ์ก์์ฃผ์๋๊ฒ ์ข์ต๋๋ค! |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | - exists ๋ฉ์๋ ๋๋ฌด ์ ํ์ฉํ์
จ๋ค์!! ๐
- ์ฌ๊ธฐ์ exists ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ๋ก ๋ณ์์ ์ ์ฅํด์ค๊ฒ ์์ด ์๋ if ๋ฌธ์ ๋ฐ๋ก ์ ์ฉํด์ฃผ์ ๋ค๋ฉด ๋ถํ์ํ ๋ณ์ ์ ์ธ์ ์์จ ์ ์๊ฒ ์ฃ ?! |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | or, not, in ํ์ฉ ๋๋ฌด ์ข์ต๋๋ค ํธ์ด๋!!! ๊ทธ๋ฐ๋ฐ email ์ list ๋ก ํ๋ณํํด์ฃผ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | ์์ ๋ฆฌ๋ทฐ ๋ด์ฉ ๋ฐ์ํด์ฃผ์๋ฉด ์ด ๋ถ๋ถ์ ์์ ์ฌํญ์ด ์๊ธฐ๊ฒ ์ฃ !? |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | `or` ๊ณผ `is` ์ค์ ์ด๋ค๊ฒ ์ฐ์ ์์์ผ๊น์? ์กฐ๊ฑด๋ฌธ์์ operator precedence ์ ๋ฐ๋ผ ์กฐ๊ฑด์ด ์์ ํ ๋ฐ๋ ์ ์๊ธฐ ๋๋ฌธ์ ์ ํ์
ํ๊ณ ์ฌ์ฉํ์๋๊ฒ ์ข์ต๋๋ค! |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | ์ด ๋ถ๋ถ๋ค์์๋ ํ์ด์ฌ์ exception ์ด ๋ฐ์ํ ์ ์์ต๋๋ค. Exception handling ์ ๋ํด์ repl.it ์์ ๋ณด์ ์ ์ด ์์ผ์ ๋ฐ์! ์ค์ ๋ก view ์์ ์ ๋ง์ ๋ง ์ค์ํ ์ญํ ์ ํ๋ ๋งํผ ๊ผญ ์ถ๊ฐ๋์ด์ผ ํ๋ ๋ก์ง์
๋๋ค.
์ด ์ฝ๋๋ค์์ ์ด๋ค exception ์ด ๋ฐ์ํ ์ ์์์ง ํ์ธํด๋ณด์๊ณ ํธ๋ค๋ง ๋ก์ง ์ถ๊ฐํด์ฃผ์ธ์! |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | ์ด์ bcrypt ๋ฅผ ํ์ฉํ์ฌ ๋น๋ฐ๋ฒํธ ์ํธํ ๋ก์ง ์ถ๊ฐํด์ ์ ์ฅํด์ฃผ์ธ์! |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | CREATED ๋ฅผ ์๋ฏธํ๋ 201 ์ฌ์ฉ ๋๋ฌด ์ํ์
จ์ต๋๋ค! ๐ |
@@ -0,0 +1,12 @@
+from django.db import models
+
+class User(models.Model):
+
+ email = models.EmailField(max_length=50, unique=True)
+ name = models.CharField(max_length=50, unique=True)
+ phone = models.CharField(max_length=50, unique=True)
+ password= models.CharField(max_length=500)
+
+ class... | Python | ํด๋ํฐ ๋ฒํธ๋ ๊ณ ์ ๊ฐ์ด๋ ์์ฒ๋ผ ๊ณ ์ ๊ฐ์ ๋ปํ๋ ์ต์
์ ์ถ๊ฐํด์ฃผ์
์ผ ํฉ๋๋ค! |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | string / list ์ ๋ํ ์ดํด๊ฐ ๋ถ์กฑํ์ต๋๋ค.
- [x] Strings can be indexed (subscripted), with the first character having index 0. There is no separate character type; a character is simply a string of size one:
- [x] if '.' not in email or '@' not in email: |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | ๋ถํ์ํ ์ฃผ์ ์ ์ธํ๊ณ ์ฌ๋ ค์ฃผ์ธ์. |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | else ๋ถํ์ |
@@ -0,0 +1,76 @@
+import json,bcrypt,jwt
+from json.decoder import JSONDecodeError
+
+from django.db.models import Q
+from django.views import View
+from django.http import JsonResponse
+
+from .models import User
+from my_settings import SECRET_KEY, ALGORITHM
+
+
+class SignUpView(View):
+ ... | Python | ์ฑ๊ณต ์ผ์ด์ค์์ ์ธ ๋ก์ง์ด๊ธฐ ๋๋ฌธ์ ์๋๋ก ์์น์์ผ์ฃผ์ธ์. |
@@ -0,0 +1,29 @@
+package nextstep.security.authorization;
+
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authentication.AuthenticationException;
+import org.aopalliance.intercept.MethodInvocation;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+public class SecuredA... | Java | method.getAnnotation(Secured.class)๋ฅผ ์ฌ์ฉํ์ฌ `@Secured` ์ด๋
ธํ
์ด์
์ ์กฐํํ๊ณ ์๋ค์.
Spring AOP ํ๊ฒฝ์์๋ ๋ฉ์๋๊ฐ ํ๋ก์ ๊ฐ์ฒด๋ก ๊ฐ์ธ์ง ์ ์๊ธฐ ๋๋ฌธ์, ํ๋ก์๋ ๋ฉ์๋๋ฅผ ์กฐํํ ๊ฒฝ์ฐ ์ค์ ๊ตฌํ์ฒด์ ๋ฉ์๋์์ ์ ์ธ๋ `@Secured` ์ด๋
ธํ
์ด์
์ ์ฐพ์ง ๋ชปํ ๊ฐ๋ฅ์ฑ์ด ์์ต๋๋ค.
method.getAnnotation ์ AopUtils.getMostSpecificMethod() ์ด๋ค ์ฐจ์ด๊ฐ ์์๊น์? ๐ |
@@ -23,7 +23,7 @@
@AutoConfigureMockMvc
class BasicAuthTest {
private final Member TEST_ADMIN_MEMBER = new Member("a@a.com", "password", "a", "", Set.of("ADMIN"));
- private final Member TEST_USER_MEMBER = new Member("b@b.com", "password", "b", "", Set.of());
+ private final Member TEST_USER_MEMBER = new M... | Java | ํ
์คํธ ์ฝ๋ ๐ |
@@ -0,0 +1,29 @@
+package nextstep.security.authorization;
+
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authentication.AuthenticationException;
+import org.aopalliance.intercept.MethodInvocation;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+public class SecuredA... | Java | AopUtils.getMostSpecificMethod()๋ฅผ ์ฌ์ฉํ๋ฉด ํ๋ก์ ๊ฐ์ฒด๋ ์๋๋ ์ค์ ๊ฐ์ฒด์ ๋ฉ์๋๋ฅผ ์กฐํํ์ฌ @Secured ์ด๋
ธํ
์ด์
์ ๋ชป์ฐพ๋ ๊ฒฝ์ฐ๊ฐ ๋ฐ์ํ์ง ์๊ฒ ๋ค์!
๊ฐ์ฌํฉ๋๋ค :) |
@@ -0,0 +1,41 @@
+package nextstep.security.authorization.manager;
+
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authorization.AuthorizationDecision;
+import nextstep.security.authorization.Secured;
+import org.aopalliance.intercept.MethodInvocation;
+import org.springframework.co... | Java | ```suggestion
if (authentication == null) {
return AuthorizationDecision.ACCESS_DENIED;
}
```
๊ถํ์ ๋ฐ๋ฅธ ์์ธ ์ฒ๋ฆฌ๋ Interceptor์ ์ญํ ๋ก ๋๊ฒจ์ฃผ๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,28 @@
+package nextstep.security.authorization.manager;
+
+import jakarta.servlet.http.HttpServletRequest;
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authorization.AuthorizationDecision;
+import nextstep.security.authorization.access.RequestMatcherEntry;
+
+import java... | Java | AuthorizationManager์ ๋ํ ์ถ์ํ๋ฅผ ์ ํด์ฃผ์
จ๋ค์ ๐ |
@@ -1,13 +1,23 @@
package nextstep.app;
+import jakarta.servlet.http.HttpServletRequest;
import nextstep.app.domain.Member;
import nextstep.app.domain.MemberRepository;
import nextstep.security.authentication.AuthenticationException;
import nextstep.security.authentication.BasicAuthenticationFilter;
import next... | Java | `๊ทธ ์ธ ๋ชจ๋ ์์ฒญ์ ๊ถํ์ ์ ํํ๊ธฐ ์ํด DenyAllAuthorizationManager๋ก ์ฒ๋ฆฌ`
ํด๋น ์๊ตฌ์ฌํญ์ด ๋ฐ์ ์๋์ด ์๋ ๊ฒ ๊ฐ๋ค์! |
@@ -1,13 +1,23 @@
package nextstep.app;
+import jakarta.servlet.http.HttpServletRequest;
import nextstep.app.domain.Member;
import nextstep.app.domain.MemberRepository;
import nextstep.security.authentication.AuthenticationException;
import nextstep.security.authentication.BasicAuthenticationFilter;
import next... | Java | ๋ช
ํํ ์ญํ ์ ๊ตฌ๋ถํ๊ธฐ ์ํด AuthenticatedAuthorizationManager์ HasAuthorityAuthorizationManager๋ฅผ ๋ถ๋ฆฌํด์ ๊ตฌํํด๋ด๋ ์ข๊ฒ ๋ค์! |
@@ -0,0 +1,41 @@
+package nextstep.security.authorization.manager;
+
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authorization.AuthorizationDecision;
+import nextstep.security.authorization.Secured;
+import org.aopalliance.intercept.MethodInvocation;
+import org.springframework.co... | Java | ์์ธ ์ฑ
์์ Interceptor์์ ํ๋ ๊ฒ์ด ๋ง๋ ๊ฒ ๊ฐ์์ ์์ ํ์์ต๋๋ค ! |
@@ -1,13 +1,23 @@
package nextstep.app;
+import jakarta.servlet.http.HttpServletRequest;
import nextstep.app.domain.Member;
import nextstep.app.domain.MemberRepository;
import nextstep.security.authentication.AuthenticationException;
import nextstep.security.authentication.BasicAuthenticationFilter;
import next... | Java | ์ ์ด๋ถ๋ถ์ ๋นผ๋จน์๊ตฐ์ ใ
ใ
ใ
permitAll()์ด ์๋๋ผ denyAll()๋ก ์ฒ๋ฆฌํ ๋ค, ํ
์คํธ ์ถ๊ฐํ๋๋ก ํ๊ฒ ์ต๋๋ค. |
@@ -1,13 +1,23 @@
package nextstep.app;
+import jakarta.servlet.http.HttpServletRequest;
import nextstep.app.domain.Member;
import nextstep.app.domain.MemberRepository;
import nextstep.security.authentication.AuthenticationException;
import nextstep.security.authentication.BasicAuthenticationFilter;
import next... | Java | ์๋
ํ์ธ์ ์ฌ์ฐ๋ !
์ ๊ฐ ์ด๋ถ๋ถ ์ฝ๋ฉํธ๋ฅผ ์ ํํ๊ฒ ์ดํดํ์ง๋ ๋ชปํ ๊ฒ ๊ฐ์ต๋๋ค.
๊ธฐ์กด ์ ๊ฐ ๊ตฌํํ ๋ถ๋ถ์ AuthorityAuthorizationManager<T>์์ ์ฒ๋ฆฌํ ๊ถํ๋ค์ ๊ฐ์ง๊ณ ์๊ณ , AuthoritiesAuthorizationManager๋ ์ ๋ฌ๋ฐ์ Role๋ค๋ก ๊ฒ์ฌ๋ง ํ๋ ์ฑ
์์ ๊ฐ์ง๊ณ ์๋๋ฐ์.
HasAuthorityAuthorizationManager๋ผ๋ ๊ฒ์ delegateํ์ง ์๊ณ , ์ค์ค๋ก ์ฒ๋ฆฌํ ์ญํ ์ ์๊ณ ์๊ณ ์ฒ๋ฆฌํ๋ ๊ฐ์ฒด๋ฅผ ์๋ฏธํ์๋ ๊ฒ ๋ง์๊น์!? |
@@ -1,13 +1,23 @@
package nextstep.app;
+import jakarta.servlet.http.HttpServletRequest;
import nextstep.app.domain.Member;
import nextstep.app.domain.MemberRepository;
import nextstep.security.authentication.AuthenticationException;
import nextstep.security.authentication.BasicAuthenticationFilter;
import next... | Java | ํด๋น ์ฝ๋ฉํธ๋ ํด๋น ๊ฐ์ฒด๊ฐ ํ๋์ ์ญํ ๋ง ๋ด๋นํ๋ฉด ๊ฐ๋
์ฑ์ด ๋ ์ข์์ง ๊ฒ ๊ฐ์ ๋จ๊ธด๊ฑด๋ฐ์.
์คํ๋ง ์ํ๋ฆฌํฐ๋ ์ฐฌํธ๋์ด ๊ตฌํํ์ ๋ฐฉ์์ฒ๋ผ ๋ถ๋ฆฌ๋์ด ์์ง ์์ ์ฝ๋๋ผ์ ๊ผญ ๋ฐ์ํ์ค ํ์๋ ์์ง๋ง..
์ ๊ฐ ๋ดค์ ๋ ์คํ๋ง ์ํ๋ฆฌํฐ๋ ์ญํ ์ ๊ตฌ๋ถํ๋ฉด ๋ ๊ฐ๋
์ฑ์ด ์ข์์ง ๊ฒ ๊ฐ์์ ใ
ใ
ํ ๋ฒ ๊ณ ๋ฏผํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์ ์ฝ๋ฉํธ๋ฅผ ๋จ๊ฒผ์ต๋๋ค~ |
@@ -0,0 +1,37 @@
+[
+ {
+ "id": 1,
+ "img": "images/yoonhee/imgg.jpg",
+ "text": "ํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ"
+ },
+ {
+ "id": 2,
+ "img": "images/yoonhee/imgg.jpg",
+ "text": "ํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ดํ๊ตญ์ด... | Unknown | ์ ๊ตญ์ ์คํฌ๋์ ๋ป ์ ์๊ฒ ์ต๋๋ค. |
@@ -1,9 +1,23 @@
import React from 'react';
+import './Login.scss';
+import LoginForm from './LoginForm';
-class Login extends React.Component {
+class LoginYoonHee extends React.Component {
render() {
- return null;
+ return (
+ <article className="login-art">
+ <div className="log-in__main">
+... | JavaScript | props์ ๊ฐ๋
์ ๋ํด ์ ์ดํดํ์
จ๋ค์!
ํ์ง๋ง ์ด๋ ๊ฒ ํ ํ์ ์์ด, `<LoginForm>` ์ปดํฌ๋ํธ์์ withRouter importํด์ ๊ฐ์ธ์ฃผ์๋ ๋ฐฉ์์ผ๋ก ํ์๋ ๊ฒ ์ข์ ๊ฒ ๊ฐ๋ค์! |
@@ -0,0 +1,75 @@
+.login-art {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ background-color: var(--color-boxgray);
+
+ .log-in__main {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-evenly;
+ align-items: center;
+ width: 300px;
+ he... | Unknown | - ํ๋์ ์์์ ์ฌ๋ฌ๊ฐ์ง ์์ฑ์ ๋ถ์ฌํ๋ ๊ฒฝ์ฐ ์ค์๋, ๊ด๋ จ๋์ ๋ฐ๋ผ์ ๋๋ฆ์ convention์ ์ง์ผ์ ์์ฑํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
- ์ผ๋ฐ์ ์ธ convention ์ ์๋์ ๊ฐ์ต๋๋ค. ์๋์ ๊ฐ์ด ์์ ์ ์ฉํด์ฃผ์ธ์.
[CSS property ์์]
- Layout Properties (position, float, clear, display)
- Box Model Properties (width, height, margin, padding)
- Visual Properties (color, backgrou... |
@@ -0,0 +1,51 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+
+class LoginForm extends React.Component {
+ constructor() {
+ super();
+ this.state = { id: '', ps: '' };
+ }
+
+ goToMain = e => {
+ this.props.history.push('/main-yoonhee');
+ };
+
+ handleInput = e => {
+ ... | JavaScript | ๊ณ์ฐ๋ ์์ฑ๋ช
์ ํ์ฉํด์ฃผ์
จ๋ค์! :) |
@@ -0,0 +1,10 @@
+import React from 'react';
+
+class Comment extends React.Component {
+ render() {
+ const { innerText } = this.props;
+ return <li>{innerText}</li>;
+ }
+}
+
+export default Comment; | JavaScript | map ๋ฉ์๋๋ฅผ ์ฌ์ฉํ์๋ ๋ถ๋ถ์์ key prop ๋ถ์ฌํด์ฃผ์๋ฉด ๋ฉ๋๋ค! |
@@ -0,0 +1,59 @@
+import React from 'react';
+import Comment from './Comment';
+
+class CommentBox extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { feedComment: '', commentList: [] };
+ }
+
+ handleInput = e => {
+ this.setState({ [e.target.name]: e.target.value });
+ };
+
... | JavaScript | isKeyEnter๋ผ๋ ํจ์๋ช
์ key๊ฐ enter์ธ์ง ์๋์ง๋ฅผ ํ๋ณํ๋ boolean ๋ณ์๋ช
์ผ๋ก ์ ํฉํ ๊ฒ ๊ฐ๋ค์.
ํจ์์ ๋์์ ๋ํ ๋ด์ฉ์ ์ง๊ด์ ์ผ๋ก ์ ์ ์๋ ๋์ฌํ์ผ๋ก ์์ฑํด์ฃผ์ธ์!
ex) addCommentByEnter |
@@ -0,0 +1,59 @@
+import React from 'react';
+import Comment from './Comment';
+
+class CommentBox extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { feedComment: '', commentList: [] };
+ }
+
+ handleInput = e => {
+ this.setState({ [e.target.name]: e.target.value });
+ };
+
... | JavaScript | ๋ฆฌ๋ทฐํ์ง ์์ ๋ถ๋ถ๋ ์์ ํด์ฃผ์ธ์! |
@@ -0,0 +1,59 @@
+import React from 'react';
+import Comment from './Comment';
+
+class CommentBox extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { feedComment: '', commentList: [] };
+ }
+
+ handleInput = e => {
+ this.setState({ [e.target.name]: e.target.value });
+ };
+
... | JavaScript | - `newfeedComment`๋ผ๊ณ ์๋ก ์ ์ธํ๊ณ ํ ๋นํ ํ์ ์์ด, concat ๋ฉ์๋์ feedComment๋ผ๋ state๋ฅผ ์ง์ ๋ฃ์ด์ฃผ์
๋ ๋ ๊ฒ ๊ฐ๋ค์.
- concat ์ ์ฌ์ฉํด์ฃผ์
จ๋๋ฐ, concat ๋์ ์ spread operator๋ฅผ ์ฌ์ฉํด์ ๋์ผํ๊ฒ ๊ตฌํํด๋ณด์ค ์ ์์ต๋๋ค.
์ฐ์ตํ๋ค๊ณ ์๊ฐํ์๊ณ ์ฐพ์์ ๊ตฌํํด๋ณด์ธ์!
```suggestion
const { feedComment, commentList } = this.state;
this.setState({
commentList: commentList.con... |
@@ -0,0 +1,59 @@
+import React from 'react';
+import Comment from './Comment';
+
+class CommentBox extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { feedComment: '', commentList: [] };
+ }
+
+ handleInput = e => {
+ this.setState({ [e.target.name]: e.target.value });
+ };
+
... | JavaScript | ์ด ์ปดํฌ๋ํธ์ tag๋ค์์ id์ className์ ๊ฐ์ด ๋ถ์ฌํ์ ์ด์ ๊ฐ ์์๊น์?? |
@@ -0,0 +1,59 @@
+import React from 'react';
+import Comment from './Comment';
+
+class CommentBox extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { feedComment: '', commentList: [] };
+ }
+
+ handleInput = e => {
+ this.setState({ [e.target.name]: e.target.value });
+ };
+
... | JavaScript | ์์ ๋ฆฌ๋ทฐ๋๋ฆฐ ๋ด์ฉ์ด๋ค์! index๋ฅผ props๋ก ๋๊ฒจ์ฃผ๋ ๊ฒ ์๋๋ผ, ์ด ๋ถ๋ถ์์ key={index}๋ก ๋ถ์ฌํด์ฃผ์๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,59 @@
+import React from 'react';
+import Comment from './Comment';
+
+class CommentBox extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { feedComment: '', commentList: [] };
+ }
+
+ handleInput = e => {
+ this.setState({ [e.target.name]: e.target.value });
+ };
+
... | JavaScript | ๊ทธ๋ฆฌ๊ณ cur์ด๋ผ๋ ๋ณ์๋ช
์ ์ด๋ค ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ง๊ณ ์๋์ง ๋ช
ํํ์ง ์์๋ฐ, ํด๋น ๋ณ์๊ฐ ๋ด๊ณ ์๋ ๋ฐ์ดํฐ์ ๋ํ ๋ด์ฉ์ด ์ข ๋ ์ง๊ด์ ์ผ๋ก ๋๋ฌ๋ ์ ์๋๋ก ์์ ํด์ฃผ์ธ์!
ex) comment |
@@ -0,0 +1,32 @@
+import React from 'react';
+import Feed from './Feed';
+
+class Feeds extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ feeds: [],
+ };
+ }
+
+ componentDidMount() {
+ fetch('/data/feed.json')
+ .then(res => res.json())
+ .then(data => {
... | JavaScript | - method ์ ์๋ตํด์ฃผ์
จ๋ค์! ๐
- ์ถ๊ฐ์ ์ผ๋ก, `http://localhost:3000` ๋ถ๋ถ๋ ์๋ตํ ์ ์์ต๋๋ค. ํฌํธ ๋ฒํธ๊ฐ ๋ฐ๋ ๋๋ง๋ค ์๋ฌ๊ฐ ๋ฐ์ํ๊ณ ๊ทธ๋๊ทธ๋ ์์ ํด์ค์ผ ํ๋ ๋ฒ๊ฑฐ๋ก์์ด ์๊ธฐ ๋๋ฌธ์, ๋ค์๊ณผ ๊ฐ์ด ์๋ตํด์ ์ฌ์ฉํด์ฃผ์ธ์!
```suggestion
fetch('/data/feed.json')
``` |
@@ -0,0 +1,32 @@
+import React from 'react';
+import Feed from './Feed';
+
+class Feeds extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ feeds: [],
+ };
+ }
+
+ componentDidMount() {
+ fetch('/data/feed.json')
+ .then(res => res.json())
+ .then(data => {
... | JavaScript | ์ค์ ์ฌ๊ธฐ์๋ key prop ์ ๋ถ์ฌํด์ฃผ์
จ๋ค์!
์ด์ง ํ ์ ์ก์๋ฉด,, ๋งค๊ฐ๋ณ์์ ๋ฐ์ดํฐ๋ ๊ฐ ํผ๋์ ๋ํ ๋ฐ์ดํฐ์ด๊ธฐ ๋๋ฌธ์ feeds -> feed๊ฐ ๋ ์ ์ ํ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -1,9 +1,22 @@
+// eslint-disable-next-line
import React from 'react';
+import Nav from './Nav';
+import Feeds from './Feeds';
+import MainR from './MainR';
+import './Main.scss';
-class Main extends React.Component {
+class MainYoonHee extends React.Component {
render() {
- return null;
+ return (
+ ... | JavaScript | import ์์ ์์ ํด์ฃผ์ธ์! ์ผ๋ฐ์ ์ธ convention์ ๋ฐ๋ผ ์์๋ง ์ ์ง์ผ์ฃผ์
๋ ๊ฐ๋
์ฑ์ด ์ข์์ง๋๋ค. ์๋ ์์ ์ฐธ๊ณ ํด์ฃผ์ธ์.
- React โ Library(Package) โ Component โ ๋ณ์ / ์ด๋ฏธ์ง โ css ํ์ผ(scss ํ์ผ) |
@@ -0,0 +1,25 @@
+import React from 'react';
+
+class Recommend extends React.Component {
+ render() {
+ const { nickname, img } = this.props;
+ return (
+ <li className="user main-right__user2">
+ <div className="user-and-botton">
+ <img
+ className="user__img user__img--brder-re... | JavaScript | `<li>`ํ๊ทธ, `<div>`ํ๊ทธ ๋ ์ค ํ๋๋ก๋ง ๊ฐ์ธ์ฃผ์
๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,22 @@
+import React from 'react';
+
+class Story extends React.Component {
+ render() {
+ const { nickname, img } = this.props;
+ return (
+ <li className="user main-right__user">
+ <img
+ className="user__img user__img--brder-red"
+ alt={nickname}
+ src={img}
+ ... | JavaScript | ์ฌ๊ธฐ๋ ๋ง์ฐฌ๊ฐ์ง-! |
@@ -0,0 +1,281 @@
+/*------๊ณตํต-----*/
+/*------๊ณตํต-----*/
+
+.main-body {
+ background-color: var(--color-boxgray);
+}
+
+main {
+ display: flex;
+ margin-left: 100px;
+}
+
+ul > li {
+ margin: 10px 0;
+}
+
+a {
+ text-decoration: none;
+ color: inherit;
+}
+
+.box {
+ background-color: white;
+ border: 1px solid... | Unknown | ๊ณตํต์ผ๋ก ์ฌ์ฉํ๋ ์์ฑ์ ํ์๋ค๊ณผ ์์ํ์ฌ common.scss ํ์ผ๋ก ์ฎ๊ฒจ์ฃผ์ธ์! |
@@ -0,0 +1,59 @@
+import React from 'react';
+import Comment from './Comment';
+
+class CommentBox extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { feedComment: '', commentList: [] };
+ }
+
+ handleInput = e => {
+ this.setState({ [e.target.name]: e.target.value });
+ };
+
... | JavaScript | ๋ฆฌ์กํธ๋ก ํ์ผ ์ฎ๊ฒจ์ค๊ธฐ์ jsํ์ผ๋ก๋ง ์์
ํ ๋ ๋์ผ๋ก ์ ๊ทผํ๋ ์ฉ๋๋ก ์ฐ๊ณ ์ง์ฐ๋๊ฑธ ๊น๋นกํ๋ค์ โฆ;;;ใ
ใ
์ง์ ์ต๋๋ค! |
@@ -1,9 +1,23 @@
import React from 'react';
+import './Login.scss';
+import LoginForm from './LoginForm';
-class Login extends React.Component {
+class LoginYoonHee extends React.Component {
render() {
- return null;
+ return (
+ <article className="login-art">
+ <div className="log-in__main">
+... | JavaScript | ์์ ํ์ต๋๋น! ๋๋ถ์ ๋ผ์ฐํฐ์ ๋ํด์ ์ข ๋ ์๊ฒ๋๋ค์ฉ ใ
ใ
|
@@ -0,0 +1,10 @@
+import React from 'react';
+
+class Comment extends React.Component {
+ render() {
+ const { innerText } = this.props;
+ return <li>{innerText}</li>;
+ }
+}
+
+export default Comment; | JavaScript | ์์ ํ์ต๋๋ค-! key๊ฐ ๋ฃ๋๊ณณ์ ์ ํํ ๋ชจ๋ฅด๊ณ ์์๋๋ฐ ์ด์ ์ ํํ๊ฒ ์๊ฑฐ๊ฐ์์! |
@@ -0,0 +1,32 @@
+import React from 'react';
+import Feed from './Feed';
+
+class Feeds extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ feeds: [],
+ };
+ }
+
+ componentDidMount() {
+ fetch('/data/feed.json')
+ .then(res => res.json())
+ .then(data => {
... | JavaScript | ์์ ํ์ต๋๋ค-! ํฌํธ๋ฒํธ๋ ์๋ต์ผ๋ฃจ! ํ ๊ฐ์ฌํฉ๋๋น! |
@@ -0,0 +1,32 @@
+import React from 'react';
+import Feed from './Feed';
+
+class Feeds extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ feeds: [],
+ };
+ }
+
+ componentDidMount() {
+ fetch('/data/feed.json')
+ .then(res => res.json())
+ .then(data => {
... | JavaScript | feed๋ก ์์ ์๋ฃ ํ์ต๋๋น ๐ |
@@ -1,9 +1,22 @@
+// eslint-disable-next-line
import React from 'react';
+import Nav from './Nav';
+import Feeds from './Feeds';
+import MainR from './MainR';
+import './Main.scss';
-class Main extends React.Component {
+class MainYoonHee extends React.Component {
render() {
- return null;
+ return (
+ ... | JavaScript | scssํ์ผ ์๋๋ก ์์น์์ ํ์ต๋๋น ! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.