-Python -m venv myvenv 가상환경 설정
-Source myvenv/Scripts/activate 가상환경 실행
-Pip install Django
가상환경 실행 상에서 설치해야 됨
-Django-admin startproject 프로젝트 이름
-Python manage.py startapp 앱 이름
:기능별로 앱을 설정하여 mtv패턴을 적용
-Settings.py의 installed_apps에 앱 이름 추가
:django가 설치된 앱을 인식해야 함
-Urls.py --path(‘account/’, include(‘accountapp.urls))
:account/~-->account앱에서의 urls.py 설정 값이 물결에 적용됨
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def hello_world(request):
return HttpResponse('안녕하세요')
models.py class 작성 (14강) (0) | 2021.07.15 |
---|---|
static 설정(11강) (0) | 2021.07.15 |
부트스트랩 적용 (10강) (0) | 2021.07.15 |
include와 extends 이용 (pinterest clone 9강) (0) | 2021.07.14 |
templates내용 뜨게 하기(pinterest clone 8강) (0) | 2021.07.14 |
댓글 영역