상세 컨텐츠

본문 제목

django project 시작(pinterest clone 5강)

django

by 개복신 개발자 2021. 7. 14. 12:38

본문

반응형

-Python -m venv myvenv 가상환경 설정

-Source myvenv/Scripts/activate 가상환경 실행

-Pip install Django

가상환경 실행 상에서 설치해야 됨

 

-Django-admin startproject 프로젝트 이름

-Python manage.py startapp 앱 이름

:기능별로 앱을 설정하여 mtv패턴을 적용

 

-Settings.pyinstalled_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('안녕하세요')
반응형

'django' 카테고리의 다른 글

관련글 더보기

댓글 영역