|
76 | 76 | ```
|
77 | 77 |
|
78 | 78 | - 각 데이터베이스 필드를 `Field` 클래스의 인스턴스로 표현
|
79 |
| -- `ForeignKey()` : 왜래키 참조 |
| 79 | +- `ForeignKey()` : 외래키 참조 |
80 | 80 |
|
81 | 81 | <br>
|
82 | 82 |
|
@@ -116,7 +116,7 @@ CREATE INDEX "polls_choice_question_id_c5b4b260" ON "polls_choice" ("question_id
|
116 | 116 | COMMIT;
|
117 | 117 | ```
|
118 | 118 |
|
119 |
| -- 데이터베이스 모델 관련 테이블 생성하기 (변경사항 데이트베이스에 적용) |
| 119 | +- 데이터베이스 모델 관련 테이블 생성하기 (변경사항 데이터베이스에 적용) |
120 | 120 | ```bash
|
121 | 121 | $ python manage.py migrate
|
122 | 122 | Operations to perform:
|
@@ -260,3 +260,29 @@ In [20]: c.delete()
|
260 | 260 | Out[20]: (1, {'polls.Choice': 1})
|
261 | 261 | ```
|
262 | 262 |
|
| 263 | +## 관리자 생성하기 |
| 264 | +```bash |
| 265 | +$ python manage.py createsuperuser |
| 266 | +Username (leave blank to use 'user'): admin |
| 267 | +Email address: chaeyeonhee@kakao.com |
| 268 | +Password: |
| 269 | +Password (again): |
| 270 | +Superuser created successfully. |
| 271 | +``` |
| 272 | + |
| 273 | +<br> |
| 274 | + |
| 275 | +- 개발 서버 : http://127.0.0.1:8000/admin/ |
| 276 | +```bash |
| 277 | +- $ python manage.py runserver |
| 278 | +Watching for file changes with StatReloader |
| 279 | +Performing system checks... |
| 280 | + |
| 281 | +System check identified no issues (0 silenced). |
| 282 | +August 24, 2021 - 19:56:57 |
| 283 | +Django version 3.2.6, using settings 'mysite.settings' |
| 284 | +Starting development server at http://127.0.0.1:8000/ |
| 285 | +Quit the server with CTRL-BREAK. |
| 286 | +[24/Aug/2021 19:57:21] "GET /admin/ HTTP/1.1" 302 0 |
| 287 | +... |
| 288 | +``` |
0 commit comments