PROJECTS

Django | ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ (์•ฑ) ๋งŒ๋“ค๊ธฐ | Django Admin ๊ณ„์ • ์ƒ์„ฑ๊ณผ ๋กœ๊ทธ์ธํ•˜๊ธฐ

nicesugi 2022. 5. 27. 16:07

๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป Github

https://github.com/nicesugi/DjangoClass/tree/main/django/sns


๐ŸŒฑ ์•ฑ ๋งŒ๋“ค๊ธฐ 

1. ํ„ฐ๋ฏธ๋„

๋ณด์‹œ๋ฉด ์•„์‹œ๊ฒ ์ง€๋งŒ, user์™€ tweet์˜ ์ด๋ฆ„์€ ์›ํ•˜์‹œ๋Š” ๊ฑธ๋กœ ๋ฐ”๊พธ์…”๋„ ๋ฌด๊ด€ํ•ฉ๋‹ˆ๋‹ค. (๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ๋“ค์–ด๊ฐˆ ์ด๋ฆ„)

django-admin startapp user
django-admin startapp tweet

ํ„ฐ๋ฏธ๋„

 

2. ์•ฑ ๋งŒ๋“ค๊ธฐ - mySpartaSns > settings.py

์™ผ์ชฝ ์ฝ”๋“œ์˜ 10,11๋ฒˆ์งธ ์ค„์„ ์ถ”๊ฐ€ํ•ด์ค๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋ฉด ์˜ค๋ฅธ์ชฝ ํƒ์ƒ‰๊ธฐ์ฒ˜๋Ÿผ ์•ฑ์ด ์ƒ๊ธฐ๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!

์ขŒ-mySpartaSns-settings.py / ์šฐ-์•ฑ ์ƒ์„ฑ ์™„๋ฃŒ, ํƒ์ƒ‰๊ธฐํ™•์ธ


๐ŸŒฑ Django Admin

์žฅ๊ณ  ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ ํ›„, http://127.0.0.1:8000/admin ์ ‘์†ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ํ™”๋ฉด์ด ๋ณด์ž…๋‹ˆ๋‹ค.

๋“ค์–ด๊ฐ€๊ธฐ ์œ„ํ•ด ๊ณ„์ •์„ ์ƒ์„ฑํ•ด์ฃผ๊ณ  ๋กœ๊ทธ์ธ์„ ํ•ด๋ด…์‹œ๋‹ค.

http://127.0.0.1:8000/admin

1. ํ„ฐ๋ฏธ๋„

python manage.py createsuperuser

Username (Leave blank to use 'ํ™๊ธธ๋™'): 
# > ๋กœ๊ทธ์ธํ•  ์œ ์ €๋„ค์ž„์„ ์ ์–ด์ค๋‹ˆ๋‹ค.

Email : 
# > ์ด์šฉํ•  ์ด๋ฉ”์ผ์„ ์ ์–ด์ค๋‹ˆ๋‹ค.

Password :
Password(again):
# > ๋น„๋ฐ€๋ฒˆํ˜ธ, ๋น„๋ฐ€๋ฒˆํ˜ธ ์žฌ์ž…๋ ฅ์œผ๋กœ  ๋™์ผํ•œ ๋น„๋ฐ€๋ฒˆํ˜ธ์ธ์ง€ ํ™•์ธํ•ด์ค๋‹ˆ๋‹ค.

python manage.py createsuperuser

2. http://127.0.0.1:8000/admin  ๋กœ๊ทธ์ธ

http://127.0.0.1:8000/admin ๋กœ๊ทธ์ธ

 

๋ฐ˜์‘ํ˜•