실습영상
실습 메뉴얼
- 새 인스턴스를 만들기 위해서
인스턴스 생성
버튼을 클릭합니다.
- 인스턴스 이미지를 선택합니다.
- 플랫폼 : Linux/Unix
- 블루프린트 : Django
- 인스턴스 플랜을 선택합니다.
- $5 플랜 선택
- 인스턴스 이미지를 입력합니다.
- 규칙 : 유저아이디-django-todolist
- 예 : user001-django-todolist
인스턴스 생성
버튼을 클릭하여 서버 인스턴스를 생성합니다.
- 인스턴스가 활성화 될때 까지 기다립니다.
- 인스턴스가 활성화 되었으면 인스턴스명을 클릭하여 상세페이지로 이동합니다.
- 설정을 위해
SSH를 사용하여 연결
버튼을 클릭합니다.
- 인스턴스가 생긴지 얼마안된 경우에는 다음과 같은 메세지가 나오게 됩니다. 일정시간이 지나면 정상적으로 접속이 됩니다.
- 다시
SSH를 사용하여 연결
버튼을 클릭합니다.
- 다음과 같이 터미널 팝업창이 뜹니다.
- 소스코드를 설치하기 위하여 django todolist 소스코드를 git을 이용하여 다운받습니다. 소스코드를 다운 받기 위하여 명령어를 복사후 터미널에 붙여넣기 합니다.
git clone https://github.com/beomjae/django-todolist.git
- git clone 이 성공하면 다음과 같이 화면이 나옵니다.
- 다운받은 django-todolist 소스코드 디렉토리로 이동하기 위하여 명령어를 입력합니다.
cd django-todolist
- 해당 디렉토리에 소스코드가 잘 받아졌는지
ls
명령을 이용해서 파일 목록을 조회 합니다.
ls
- 프로젝트에서 사용한 라이브러리들을 설치하는 명령어를 입력합니다.
pip install -r requirements.txt
- 라이브러리 설치 결과입니다.
- 프로젝트의 데이터베이스변경내역(마이그레이션내역)을 데이터베이스에 적용합니다.
이를 위해
python manage.py migrate
명령을 입력합니다.
# migrate python manage.py migrate
- 마이그레이션 결과입니다.
- 8000번 포트로 장고 서버를 실행합니다.
- 8000번 포트로 장고 서버가 실행되었습니다.
- 라이트세일 장고 인스턴스정보에서 퍼블릭 IP 주소를 복사합니다.
- 웹브라우저에서 새 탭을 열고
http://퍼블릭 IP:8000
을 입력합니다. 기다려도 접속이 되지 않습니다. 이유는 8000포트에 대해 방화벽에서 막혀있기 때문입니다.
- 방화벽에서 8000번 포트를 열기 위하여
네트워킹
탭을 선택합니다.
- 방화벽 규칙을 추가하기 위하여
규칙 추가
버튼을 클릭합니다.
- 포트 입력란에
8000
을 추가합니다. 그리고생성
버튼을 클릭합니다.
- 8000번 포트가 방화벽에서 개방되었습니다.
- 이제
http://퍼블릭IP:8000
으로 접속시에 Todolists 웹사이트가 잘 열리는 것을 확인할 수 있습니다.