๐จ Projects19 [์๋ฌ๋ชจ์] fatal: 'origin' does not appear to be a git repository ์๋ฌ ์ํฉ VSCode์์ ๊นํ๋ธ๋ก push ํ ๋ ๋ฐ์ํ ์๋ฌ ํด๊ฒฐ ์ฐ์ git remote -v ๋ก ํ์ฌ ํ๋ก์ ํธ ํด๋๊ฐ ๊นํ๋ธ ๋ ํฌ์งํ ๋ฆฌ์ ์ ์ฐ๊ฒฐ๋์ด ์๋์ง ํ์ธํ๋ค. ๋ง์ฝ ์ฐ๊ฒฐ๋ ๋ ํฌ์งํ ๋ฆฌ๊ฐ ์๋ค๋ฉด ์ฐ๊ฒฐ์์ผ์ค์ผ ํ๋ค. $ git remote add origin https://github.com/cgy0627/02_PhotoApp.git # ์ด๋ ๊ฒ ํ๋ฉด https://github.com/cgy0627/02_PhotoApp.git ๋ ํฌ์งํ ๋ฆฌ๊ฐ origin ์ด๋ผ๋ ์ด๋ฆ์ผ๋ก ์ฐ๊ฒฐ๋๋ค. ๋ด ๊ฒฝ์ฐ์๋ ์ด๋ฏธ ๋ ํฌ์งํ ๋ฆฌ์ ์ ์ฐ๊ฒฐ๋์ด ์์๋ค. ์ด๋ฏธ ์ฐ๊ฒฐ์ด ๋์ด ์๋ค๋ฉด ๊นํ๋ธ๋ก push ํ ๋, ์ด๋ฏธ ์ ํด์ง remote name์ ์ฌ์ฉํด์ผํ๋ค. ์ ์คํฌ๋ฆฐ์ท์ ๋ณด์๋ค์ํผ ๋ด ๊ฒฝ์ฐ๋ remote name์ด ์ด๋ฏธ 0.. 2023. 4. 29. VSCode์ GitHub ์ฐ๋ํ๊ธฐ 2 (๋ช ๋ น์ด ๋ฒ์ ) Goal 1. VSCode์์ GitHub ์ฐ๋์ ๋ช ๋ น์ด๋ก ํ๋ ๋ฐฉ๋ฒ ์์๋ณด๊ธฐ 2. ๋ช ๋ น์ด ์์ด ํ๋ ๋ฐฉ๋ฒ๊ณผ ๋น๊ตํ๊ธฐ VSCode - GitHub ์ฐ๋ํ๊ธฐ 1. GitHub์์ ์๋ก์ด ๋ ํฌ์งํ ๋ฆฌ ๋ง๋ค๊ธฐ (Respositories > New > Create repository) 2. VSCode bash ํฐ๋ฏธ๋์์ ๋ด๊ฐ GitHub๋ก ์ฌ๋ฆฌ๊ณ ์ถ์ ํด๋ ์ด๊ธฐ 3. ํ๋ก์ ํธ์ Git ์ ์ฅ์๋ฅผ ์๋ก ์์ฑํ๊ธฐ 4. ํ์ฌ ํ๋ก์ ํธ์ ์๋ ๋ชจ๋ ๋ด์ฉ์ ์คํ ์ด์ง ์์ญ(staging area)์ ์ถ๊ฐํ๊ธฐ 5. ์คํ ์ด์ง ์์ญ์ ์ฌ๋ผ์จ ๋ด์ฉ๋ค์ ๋ฒ์ ์ผ๋ก ๊ธฐ๋กํ๊ธฐ = ์ปค๋ฐ(commit) 6. ์ฝ๋ ๋ฒ์ ๊ด๋ฆฌ๋ฅผ ์ํ ๋ฉ์ธ ๋ธ๋์น ์ด๋ฆ์ master์์ main์ผ๋ก ๋ฐ๊ฟ์ฃผ๊ธฐ 7. "origin"์ด๋ผ๋ ์ด๋ฆ์ผ๋ก 1๋ฒ์์ ์์ฑํ ๋ .. 2023. 4. 1. ์ํ ์ฝ๋ Goal 1. ์ํ ์ฝ๋์ ๋ํด ์ค๋ช ํ๊ธฐ 2. ๋ํ์ ์ธ ์ํ ์ฝ๋ ์์๋ณด๊ธฐ ์ํ ์ฝ๋๋? ์ธํฐ๋ท์ ์์ฃผ ํ์ฉํ๋ค๋ฉด ์ ๊ทธ๋ฆผ์ ๋ณด์ด๋ ํ์ด์ง๋ฅผ ํ๋ฒ์ฏค์ ๋ณด์์ ๊ฒ์ด๋ค. 404 ๋ผ๋ ๊ฒ์ด ์ํ ์ฝ๋์ด๋ค. ์ํ ์ฝ๋๋ ์ธ ์๋ฆฌ ์ซ์๋ก ํด๋ผ์ด์ธํธ์์ ์จ ์์ฒญ์ ๋ํ ์๋ฒ์ ์๋ต ์ํ๋ฅผ ๋ณด์ฌ์ค๋ค. ์ด ๊ฐ์ HTTP์ ํฌํจ ๋ ๊ฐ์ผ๋ก, ์น ๊ฐ๋ฐ์ ํ๊ณ ์๋ค๋ฉด ๊ณ์ ๋ณด๊ฒ ๋ ๊ฒ์ด๋ค. Django Rest Framework(DRF)์์๋ Response ๊ฐ์ฒด๊ฐ ์ํ ์ฝ๋์ ๋ํ ์ ๋ณด๋ฅผ ๋ด๊ณ ์๋ค. ๋ํ์ ์ธ ์ํ ์ฝ๋ HTTP ์ํ ์ฝ๋ ์๋ฏธ HTTP_200_OK ๋ฐ์ดํฐ๋ฅผ ์์ฒญํ๋ GET ์์ฒญ์ด ์ ์์ ์ผ๋ก ์ด๋ค์ก์ ๋ HTTP_201_CREATED ๋ฐ์ดํฐ๋ฅผ ์์ฑํ๋ POST ์์ฒญ์ด ์ ์์ ์ผ๋ก ์ด๋ค์ก์ ๋ HTTP_206.. 2023. 3. 26. VSCode์ GitHub ์ฐ๋ํ๊ธฐ Goal 1. VSCode ํ๋ก์ ํธ์์ GitHub ๋ ํฌ์งํ ๋ฆฌ๋ก ์ฐ๋ํ๋ ๋ฐฉ๋ฒ ์์๋ณด๊ธฐ VSCode - GitHub ์ฐ๋ํ๊ธฐ 1. GitHub์์ ์๋ก์ด ๋ ํฌ์งํ ๋ฆฌ ๋ง๋ค๊ธฐ (Respositories > New > Create repository) 2. VSCode์์ ๋ด๊ฐ GitHub๋ก ์ฌ๋ฆฌ๊ณ ์ถ์ ํด๋ ์ด๊ธฐ 3. Source Control icon > Initialize Repository ๋ง์ฝ Initialize Repository๊ฐ ๋จ์ง ์๋๋ค๋ฉด Git Bash ํฐ๋ฏธ๋ ์ฐฝ์ ์ด๊ณ "git init"์ ํด์ฃผ๋ฉด ๋๋ค. 4. ์ปค๋ฐํ ๋ฉ์ธ์ง ์ ๊ธฐ > Commit > Yes 5. ์ปค๋ฐ์ด ๋๋๋ฉด “…” ๋ฒํผ ๋๋ฅด๊ธฐ > Pull, Push > Push to… > Add Remote > 1๋ฒ์์ ๋ง๋ ๋ ํฌ์งํ ๋ฆฌ .. 2023. 3. 25. README.md ํ์ผ์ ํ ์ด๋ธ ๋ง๋ค๊ธฐ Goal 1. README.md์ ๋งํฌ๋ค์ด ์ธ์ด๋ฅผ ์ด์ฉํด์ ํ ์ด๋ธ ๋ง๋ค๊ธฐ 2. README.md ์์ ๋ณด๊ธฐ ๋งํฌ๋ค์ด ํ ์ด๋ธ ๋ง๋ค๊ธฐ ํค๋์ ํ ํ ์ด๋ธ์ ํค๋์ ํ์ผ๋ก ์ด๋ฃจ์ด์ ธ ์์ต๋๋ค. ํค๋๋ ํ ์ด๋ธ์ ์ ๋ชฉ๋ค์ด ๋ด๊ธด ๊ฐ์ฅ ์์ ์ค์ ์๋ ํ์ธ๋ฐ ๋งํฌ๋ค์ด ์ธ์ด์์๋ ํ์ดํ ์บ๋ฆญํฐ๋ฅผ ์ด์ฉํ๋ฉด ๊ฐ๋จํ ๋ง๋ค ์ ์์ต๋๋ค. ํ์ดํ ์บ๋ฆญํฐ๋ ์ผ๋ฐ์ ์ผ๋ก ํค๋ณด๋์์ Enter ๋ฐ๋ก ์์ ์๋ ์ญ์ฌ๋์ ๋ฒํผ \ ์ Shift + \ ํ๋ฉด ๋ฉ๋๋ค. ์ด๋ฆ ๊ธฐํธ ์ผ๋ฐ ์ฌ๋์ (slash) / ์ญ์ฌ๋์ (back slash) \ ํ์ดํ ์บ๋ฆญํฐ (pipe) | ํค๋ ๋งํฌ๋ค์ด ์ธ์ด๋ก๋ ์๋์ ๊ฐ์ด ์ฐ๋ฉด ๋ฉ๋๋ค. | ํค๋1 | ํค๋2 | ํค๋3 | | --- | --- | --- | ์ ๋ ฌ ์ผ์ชฝ, ์ค๋ฅธ์ชฝ, ๊ฐ์ด๋ฐ ์ ๋ ฌ์ ์๋์ ๊ฐ์ด ์ .. 2023. 3. 24. [์๋ฌ๋ชจ์] java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String ์๋ฌ ์ํฉ ์๋ฐ์์ ์ฌ๋ฌ ๋ก๊ทธ์ธ API๋ฅผ ์ด์ฉํด ๋ก๊ทธ์ธ์ ๊ตฌํํ๊ณ ์ ํ ๋ ๊ตฌ๊ธ, ํ์ด์ค๋ถ, ๋ค์ด๋ฒ๋ ๋ค ์ ๋๋๋ฐ ์นด์นด์ค UserInfo.java๋ง ์ด๋ฐ ์๋ฌ๊ฐ ๋ด๋ค. public class KakaoUserInfo implements OAuth2UserInfo { private Map attributes;// getAttributes() private Map attributesAccount;// getAttributes().get("kakao_account") private Map attributesProfile;// attributesAccount.get("profile") public KakaoUserInfo(Map attributes) { this.attributes = attributes; t.. 2023. 3. 23. MTV ํจํด Goal 1. MTV ํจํด ์ค๋ช ํ๊ธฐ 2. ์์๋ฅผ ํตํด MTV ํจํด ์์๋ณด๊ธฐ MTV ํจํด์ด๋? Model (๋ชจ๋ธ) : ์ฑ์ ๋ฐ์ดํฐ์ ๊ด๋ จ๋ ๊ธฐ๋ฅ์ ๋ค๋ฃธ Template (ํ ํ๋ฆฟ) : ์ฌ์ฉ์์๊ฒ ๋ณด์ฌ์ง๋ ๋ถ๋ถ View (๋ทฐ) : Model์ ๋ฐ์ดํฐ๋ฅผ Template์๊ฒ ์ ๋ฌํ๊ณ , Template์ ํ์ํ ์์ฒญ์ ์ฒ๋ฆฌํ๋ ๋ถ๋ถ Django์์๋ MTV ํจํด์ผ๋ก ์ ๋ฐ์ ์ธ ๊ฐ๋ฐ์ ์งํํ๋ค (์๋ฐ ์คํ๋ง์ MVC ํจํด์ด ์๋ฏ์ด). ์ด๋ฌํ ๊ฐ๋ฐ ํจํด์ ํตํด ํ๋ก์ ํธ์ ๋ณต์กํ ์ฝ๋๋ฅผ ๊ทธ๋ฃน์ง์ด ๋๋์ด ๊ฐ๋ฐ์๋ค์ ์ญํ ์ ๋๋๋๋ฐ๋ ์ ์ฉํ๊ฒ ์ฐ์ด๊ณ ์ถํ์ ํ๋ก๊ทธ๋จ์ ์ ์ง๋ณด์์ ๋ค๋ฅธ ๊ฐ๋ฐ์๊ฐ ๋ณด์์ ๋๋ ์ฝ๊ฒ ์ฝ๋ ํ๋ฆ์ ํ์ ํ ์ ์๋ค. MTV ํจํด ์์ Template์ ์ฐ๋ฆฌ๊ฐ ํํ ๋ณด๋ ์น ํ์ด์ง์ด๋ค. ์ ์์ ์์๋ ๋ด.. 2023. 3. 22. [์๋ฌ๋ชจ์] com.auth0.jwt.exceptions.AlgorithmMismatchException: The provided Algorithm doesn't match the one defined in the JWT's Header ์๋ฌ ์ค๋ช ์๋ฐ ํ๋ก์ ํธ์์ ๋ก๊ทธ์ธ์ ๊ตฌํํ๊ธฐ ์ํด ์ํ๋ฆฌํฐ ํํฐ๋ฅผ ํตํด JWT ํ ํฐ์ ์์ฑํ๊ณ ํ์ธํ๋ ๊ณผ์ ์์ ์๊ธด ์๋ฌ JwtAuthenticationFilter.java @RequiredArgsConstructor public class JwtAuthenticationFilter extends UsernamePasswordAuthenticationFilter { private final AuthenticationManager authenticationManager; // /login ์์ฒญ์ ํ๋ฉด ์ฌ์ฉ์ ์ ๋ณด๋ฅผ ์ธ์ฆํ๊ธฐ ์ํด ์คํ๋๋ ํจ์ @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServ.. 2023. 3. 21. [์๋ฌ๋ชจ์] Failed to evaluate expression 'hasRole('ROLE_USER') or hasRole('ROLE_MANAGER') or hasROLE('ROLE_ADMIN')' ์๋ฌ ์ค๋ช ์๋ฐ ํ๋ก์ ํธ์์ SecurityConfig.java๋ฅผ ํตํด ์ํ๋ฆฌํฐ ํํฐ๋ฅผ ๊ฑฐ์ณ ์น ํ์ด์ง ์ ๊ทผํ ๋ ์๊ธด ์๋ฌ @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) @RequiredArgsConstructor public class SecurityConfig extends WebSecurityConfigurerAdapter{ @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.sessionManagement().sessionC.. 2023. 3. 19. ์ด์ 1 2 3 ๋ค์