본문 바로가기
리눅스/Part1. Ch04. 웹 어플리케이션 컨테이너화

01. Django 기반 3티어 과제 소개

by Engineer-Lee 2022. 6. 28.
반응형

애플리케이션 아키텍처 스타일

특정한 특성을 공유하는 아키텍처의 집합

  • 애플리케이션을 설계하고 구축하는 데 사용하는 패턴과 기술을 설명
    패턴 → 문제에 대한 반복 가능한 솔루션
  • 종류: N 계층, 마이크로 서비스, 웹 큐 작업자, 이벤트 기반 아키텍처, 빅데이터,,,

 

 

 

 

 

실습 코드는 아래와 같다.

https://github.com/go4real/Django-Poll-App

 

GitHub - go4real/Django-Poll-App: Django poll app is a full featured polling app. You have to register in this app to show the p

Django poll app is a full featured polling app. You have to register in this app to show the polls and to vote. If you already voted you can not vote again. Only the owner of a poll can add poll , ...

github.com

 

 

 

1. 우분투 ec2 인스턴스에 접속 후 홈 디렉토리에서 mkdir projects 명령어로 새로운 프로젝트 디렉토리를 만든다.

 

2. git clone https://github.com/go4real/Django-Poll-App.git 명령어로  레포지토리를 다운로드 받는다.

 

3. sudo apt install -y python3-pip 명령어로 python package installer를 설치한다.

 

4. pip3 install -r requirements.txt 명령어로 app 실행에 필요한 관련 패키지를 설치한다.

 

5. python3 manage.py migrate 명령어로 데이터베이스 스키마를 구성한다.

 

6. python3 manage.py createsuperuser 명령어로 어드민 메뉴 사용에 필요한 관리자 계정을 생성한다.

 

7. 더미 데이터를 생성하기 위해 pip3 install faker 명령어로 faker라는 툴을 다운로드 받고

python3 manage.py shell 명령어로 파이썬 쉘 환경으로 들어가서 

import seeder
seeder.seed_all(30) 명령어를 통해 더미 데이터 30개를 생성한다.

 

그 후 exit() 명령어로 쉘을 나온다.

 

8. python3 manage.py runserver 명령어로 서버를 구동한다.

 

반응형