diff --git a/README.md b/README.md index 3eedf7c..7cf9e8f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ - 매일 아침 8:40 스크럼 회의 - 피드백 반영하여 코드 및 문서 수정 + ## Django > Django makes it easier to build better Web apps more quickly and with less code. diff --git a/docs/02-database_and_admin.md b/docs/02-database_and_admin.md index 7ef710f..24e06b9 100644 --- a/docs/02-database_and_admin.md +++ b/docs/02-database_and_admin.md @@ -76,7 +76,7 @@ ``` - 각 데이터베이스 필드를 `Field` 클래스의 인스턴스로 표현 -- `ForeignKey()` : 왜래키 참조 +- `ForeignKey()` : 외래키 참조
@@ -116,7 +116,7 @@ CREATE INDEX "polls_choice_question_id_c5b4b260" ON "polls_choice" ("question_id COMMIT; ``` -- 데이터베이스 모델 관련 테이블 생성하기 (변경사항 데이트베이스에 적용) +- 데이터베이스 모델 관련 테이블 생성하기 (변경사항 데이터베이스에 적용) ```bash $ python manage.py migrate Operations to perform: @@ -260,3 +260,29 @@ In [20]: c.delete() Out[20]: (1, {'polls.Choice': 1}) ``` +## 관리자 생성하기 +```bash +$ python manage.py createsuperuser +Username (leave blank to use 'user'): admin +Email address: chaeyeonhee@kakao.com +Password: +Password (again): +Superuser created successfully. +``` + +
+ +- 개발 서버 : http://127.0.0.1:8000/admin/ +```bash +- $ python manage.py runserver +Watching for file changes with StatReloader +Performing system checks... + +System check identified no issues (0 silenced). +August 24, 2021 - 19:56:57 +Django version 3.2.6, using settings 'mysite.settings' +Starting development server at http://127.0.0.1:8000/ +Quit the server with CTRL-BREAK. +[24/Aug/2021 19:57:21] "GET /admin/ HTTP/1.1" 302 0 +... +``` diff --git a/mysite/db.sqlite3 b/mysite/db.sqlite3 index d271c6f..0ab4cac 100644 Binary files a/mysite/db.sqlite3 and b/mysite/db.sqlite3 differ diff --git a/mysite/polls/__pycache__/admin.cpython-39.pyc b/mysite/polls/__pycache__/admin.cpython-39.pyc index 9dedba1..7122fd3 100644 Binary files a/mysite/polls/__pycache__/admin.cpython-39.pyc and b/mysite/polls/__pycache__/admin.cpython-39.pyc differ diff --git a/mysite/polls/admin.py b/mysite/polls/admin.py index 8c38f3f..aa3fdc6 100644 --- a/mysite/polls/admin.py +++ b/mysite/polls/admin.py @@ -1,3 +1,4 @@ from django.contrib import admin +from .models import Question -# Register your models here. +admin.site.register(Question) \ No newline at end of file