본문 바로가기
BE/Python & Django REST API

[Django REST API] 4. Creating a development server

by 건빵거늬 2021. 12. 17.
차례
1. Create Vagrantfile
2. Configure Vagrant box
3. Running and connecting dev server
4. Running Hello world script

1. Create Vagrantfile

(1) 기본 vagrantfile 만들기

ubuntu/bionic64 base image 를 바탕으로 vagrant 파일 만들기

vagrant box catalog에서 public available한 image임

 

(2) file 확인

 

2. Configure vagant box

Vagrantfile 내용을 다음 내용으로 붙여넣기 하기

https://gist.github.com/LondonAppDev/199eef145a21587ea866b69d40d28682

 

C1 Vagrantfile

C1 Vagrantfile. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

3. Running and connecting dev server

(1) Running dev server

[vagrant up 을 하면 일어나는 일]

1) Vagrantfile에 명시된 bionic64 base image를 다운로드 하고

2) VirtualBox를 이용하여 새로운 virtual machine을 만들고

3) 그 virtual machine을 실행할 때 provisioning sciprt를 실행한다.

 

(2) connecting dev server

virtual box가 labtop과 완전 분리되어 있는 개념이기 때문에 ssh를 통해 guest operating system에 접속해줘야 한다.

 

4. Running hello world script

dev server의 /vagrant에서 파일을 만들면
labtop 폴더에도 파일이 생긴다. 즉 synchronized 되어 있다.

5. git push

댓글