본문 바로가기
Web/Django

Django Basic 정리

by Derricks2 2021. 1. 8.
반응형

1.Virtualenv 사용 이유?

Running with the system Python and libraries limits you to one specific Python version, chosen by your OS provider. Trying to run all Python applications on one Python installation makes it likely that version conflicts will occur among the collection of libraries. It's also possible that changes to the system Python will break other OS features that depend on it

2.기본 명령어들

2.1 virtualenv 생성

python -m venv myvenv

2.2 virtualenv 활성화 시키기

myvenv/Scripts/activate

2.3 virtualenv 비활성화 시키기

deactivate

3.0 Django 기본

3.1 Django 설치

pip install django

3.2프로젝트 생성

django-admin startproject (이름) .

3.3 Django 앱 생성

python manage.py startapp (앱이름)

 

3.4 기본 로컬 서버 실행

python manage.py migrate

python manage.py runserver

https://127.0.0.1:8000/ 에서 확인

 

반응형

'Web > Django' 카테고리의 다른 글

Django 시작 하기  (0) 2020.12.06