TIL - 20180331

한 것

  • ‘클린 코드를 위한 테스트 주도개발’ 예제 따라하기 - 8장까지 완료
  • AWS Nginx static 파일 설정
location /static {
                autoindex on;
                alias 리눅스상 파일경로 위치;
}

  • AWS django 서비스 systemd 등록
  • /etc/systemd/system/django-tdd.service 경로에 아래와 같이 작성
[Unit]
Description = gunicorn
After = network.target

[Service]
PermissionsStartOnly = true
PIDFile = /run/django-tdd/django-tdd.pid
WorkingDirectory = /home/django-tdd
ExecStartPre = /usr/bin/mkdir /run/django-tdd
ExecStart = /root/.pyenv/versions/3.6.4/envs/django_tdd/bin/gunicorn django_tdd.wsgi:application -b 0.0.0.0:8001 --pid /run/django-tdd/django-tdd.pid
ExecReload = /usr/bin/kill -s HUP $MAINPID
ExecStop = /usr/bin/kill -s TERM $MAINPID
ExecStopPost = /usr/bin/rm -rf /run/django-tdd
PrivateTmp = true

[Install]
WantedBy = multi-user.target
  • 파일 권한 조정 및 daemon reload
$ chmod 755 /etc/systemd/system/django-tdd.service
$ systemctl daemon-reload
$ systemctl start django-tdd.service

할 것

  • ‘클린 코드를 위한 테스트 주도개발’ 마무리하기

느낀 것 + 의문나는 것

  • 예제코드 따라하는 것 위주로 하면서 책을 꼼꼼히 읽지 않아서 그런지.. 예제가 좀 많이 막힘..번역이 잘못된 부분도 좀 보이고..

오늘 하루 구글링 한 것들