기본 환경 : Mac OS, Python3.6, Django1.10.5


1. Python 설치(https://www.python.org/)

CentOS 7에서 Python3 설치 방법  : http://depository.tistory.com/2


2. 가상환경 생성

$ pyvenv ~/venv1

WARNING: the pyenv script is deprecated in favour of `python3.6 -m venv`

venv1폴더가 생성 됨


3. 가상환경 실행

$ . ~/venv1/bin/activate

(venv1) $


4. Django 설치

(venv1) $ pip install django

Collecting django

  Using cached Django-1.10.5-py2.py3-none-any.whl

Installing collected packages: django

Successfully installed django-1.10.5


5. Django 설치 확인

(venv1) $ python -m django --version

1.10.5


6. Django 프로젝트 생성

(venv1) $ cd ~/venv1

(venv1) venv1 $ django-admin startproject mysite

venv1 밑에 mysite 폴더가 생성 됨


7. Django 서버 구동

(venv1) venv1 $ cd mysite

(venv1) mysite $ python manage.py runserver

Performing system checks...


System check identified no issues (0 silenced).


You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.

Run 'python manage.py migrate' to apply them.


February 24, 2017 - 05:11:17

Django version 1.10.5, using settings 'mysite.settings'

Starting development server at http://127.0.0.1:8000/

Quit the server with CONTROL-C.


8. http://127.0.0.1:8000로 접속

참조: 

http://pythonstudy.xyz/

https://www.djangoproject.com/start/

'IT > Python' 카테고리의 다른 글

Python 3을 CentOS 7에 yum으로 인스톨 하는 방법  (2) 2017.02.27
Django 설치하기  (0) 2017.02.24

+ Recent posts