backend/django

장고에서 jupyter, ipython notebook 사용하기 (notebook in django)

seul chan 2017. 2. 28. 22:57

장고에서 ipython, jupyter notebook 사용하기



1. mysite (현재 사용하는 장고 폴더)에 위치한다.


2. 장고 extenstions를 설치한다. 

$pip install django-extensions 

-> Succesfully installed django-extensions-1.7.7 

라고 뜨면 성공적으로 설치된 것이다.


3. ipython, notebook을 설치한다

# ipython 설치, 이후부터는 django project 폴더에서 ipython을 사용할 수 있다.

$pip install ipython 

# notebook 설치

$pip install notebook


3. jupyter notebook을 띄운다.

$jupyter notebook


4. new-> Django Shell-Plus로 사용한다

**문제: Django Shell-Plus가 나오지 않고 Python 3만 나온다... ㅠㅠ 

----------------------------------------------------------

새로운 방법

1. mysite (현재 사용하는 장고 폴더)에 위치한다.


2. 장고 extenstions를 설치한다. 

$pip install django-extensions 

-> Succesfully installed django-extensions-1.7.7 

라고 뜨면 성공적으로 설치된 것이다.


3. mysite(프로젝트명)/settings.py 폴더 내 INSTALLED_APPS에 'django_extensions'를 추가한다

$vim settings.py


4. notebook 서버 실행하기

$python manage.py shell_plus --notebook

*새 노트북 생성 시 Django Shell-Plus를 선택하여야 한다. 




이제 장고에서 notebook을 사용할 수 있다!


참고: (http://codemath.tistory.com/34)