TECH
-
[Error] React axios post 415 errorTECH 2021. 6. 11. 15:31
์ฅ๊ณ (django)์ ๋ฆฌ์กํธ(react) ์ฐ๋ ์ค POST ๊ธฐ๋ฅ์ด ๋์ํ์ง ์์ ์ ๋ฅผ ๋จน์๋ค. 415 unsupported media type error detail: "Unsupported media type "multipart/form-data; boundary=--WebKitFormBoundary12mZg03XXxiQoXkX\" in request." await axios .post("/testapp/api/create", formData, { headers: { "Content-Type": "multipart/form-data", }, }) axios post ํค๋์ Content-Type ์ multipart/form-data๋ผ๊ณ ๋ช ์ํด ์คฌ๋๋ฐ๋ ์ ๋จนํ๋ ๊ฑด์ง 415 ์ค๋ฅ๊ฐ ๋๋ ๋ชจ์ต์ด์๋ค. ..
-
[์ฅ๊ณ ์ค๋ฅ] NoReverseMatch at /TECH 2020. 5. 22. 22:20
์ง์ง ๋์์ฒ์ ๋ณด๋ ์ค๋ฅ๋ค. ๋ฌด์จ intial-scale=1.0์ด ์๋ชป๋๋ค๊ณ ๋ฐ ๋ฆฌ๊ฐ ์๋... ์ถ์ง๋ง form ํ๊ทธ์์ action url์ ์๋ชป ์ฐ๊ฒฐํด์ ๋ฐ์ํ๋ค. ๋ค๋ฅธ ๊ฒฝ์ฐ ๊ฐ์ ์ค๋ฅ๋ ์ด๋ค ๊ฒ ์๋์ง ์ ๋ชจ๋ฅด๊ฒ ์ง๋ง ์ด์ฌ์๋ค์ ๋ง์ด ํค๋งฌ ์๋ ์๊ฒ ๋ค ์ถ๋ค.
-
[Error] git LF will be replaced by CRLF in ํ์ผ๋ชTECH 2020. 5. 21. 17:52
git add ํ์ ๋ ์ด๋ฐ ์ค๋ฅ๊ฐ ๋ด๋ค. ๊ทธ๊ฒ๋ ๊ฐ๋ง์ด... ์ฐพ์๋ณด๋ ๋งฅ/๋ฆฌ๋ ์ค์ ์๋์ฐ๊ฐ ํ์ ํ ๋ ์๊ธฐ๋ whitespace ์ค๋ฅ๋ผ๊ณ ํ๋ค. git์๋ ์ด๋ฅผ ๋ณํํด ์ฃผ๋ core.autocrlf ๊ธฐ๋ฅ์ด ์์ผ๋ฏ๋ก ์ด๋ฅผ ์ผ๋ฉด ๋๋ค. ์๋์ฐ๋ git config --global core.autocrlf true ๋ฆฌ๋ ์ค/๋งฅ์ git config --global core.autocrlf true input
-
[์ฅ๊ณ ์ค๋ฅ] admin์ model ๋ฑ๋ก์ ํ์ผ๋ http://127.0.0.1:8000/admin์ ๋ชจ๋ธ์ด ์๊ธฐ์ง ์์ ๋TECH 2020. 5. 21. 14:33
๋ชจ๋ธ๋ ๋ง๋ค๊ณ admin.py์ ๋ชจ๋ธ๋ ๋ฑ๋กํ์ผ๋ ์ ์ http://127.0.0.1:8000/admin/ ์๋ ๋ชจ๋ธ์ด ๋ณด์ด์ง ์์ ๋ settings.py์ app์ ์ถ๊ฐํ๋์ง ํ์ธํ๋ค. ์ถ๊ฐํ๋ฉด admin ํ์ด์ง์๋ ๋ง๋ ๋ชจ๋ธ์ด ๋ฌ๋ค.
-
Django date ํฌ๋งท ์ง์ TECH 2020. 5. 21. 14:32
์์ฃผ ์ฌ์ฉํ๋ ๊ฒ๋ง ์ ๋ฆฌํจ. ๋ฐ์ดํฐ ํฌ๋งท ํ์ ์ค๋ช ์ผ(Day) d ์ผ์ ๋ ์๋ฆฌ ์ซ์๋ก ํํ (01~31) j ์ผ์ ํ ์๋ฆฌ, ๋ ์๋ฆฌ ์ซ์๋ก ํํ (1~31) ์์ผ D ์์ผ์ ์์ด ์ธ ๊ธ์๋ก ํํ (ex. Fri) l ์์ผ์ ์์ด๋ก ํํ (ex. Friday) w ์์ผ์ ์ซ์๋ก ํํ (0(์ผ์์ผ)~6(ํ ์์ผ)) ์(Month) m ์์ ๋ ์๋ฆฌ ์ซ์๋ก ํํ (01~12) n ์์ ํ ์๋ฆฌ, ๋ ์๋ฆฌ ์ซ์๋ก ํํ (1~12) M ์์ ์์ด ์ธ ๊ธ์๋ก ํํ (ex. Jan) b ์์ ๋ชจ๋ ์๋ฌธ์ ์์ด ์ธ ๊ธ์๋ก ํํ (ex. jan) F ์์ ์์ด๋ก ํํ (ex. January) ๋ (Year) y ๋ ์ ๋ ์๋ฆฌ ์ซ์๋ก ํํ (ex. 20) Y ๋ ์ ๋ค ์๋ฆฌ ์ซ์๋ก ํํ (ex. 2020) ์๊ฐ g ์๊ฐ์..