1.터미널을 끈다
2.manage.pr클릭
3.python Extension이 로드된 것을 확인
django-admin start project hello
#hello라는 프로젝트를 만듭니다.
hello/hello/views.py
from django.http import HttpResponse
def imdex (request):
return HttpResponse('<h1>Hello, World!</h1>')
hello/hello/urls.py
#views.py를 import 합니다.
(18번째줄) from . import views
(20번째줄)urlpatterns = [
path('', views.index),
path('admin/', admin.site.urls),
]
Teminal
cd hello
python manage.py runserver
#포트를 다른걸로 바꾸고 싶을땐 python manage.py runserver localhost:8989
localhost:8989에 들어갔을 때 결과화면입니다.


'Django' 카테고리의 다른 글
| Django(hello>hello02)[4] href (0) | 2020.11.21 |
|---|---|
| Django(hello>hello02)[3] for, if01, if02 (0) | 2020.11.21 |
| Django(hello>hello02)[2] (0) | 2020.11.21 |
| Django(hello>hello02)[1] (0) | 2020.11.21 |
| Django(hello/hello01) (0) | 2020.11.21 |