본문 바로가기

Python/Two Scoops of Django

[Two Scoops of Django] 2. The Optimal Django Environment Setup

* 해당 포스트는 'Two Scoops of Django: Best Practices for Django 1.8 Book by Audrey Roy Greenfeld and Daniel Roy Greenfeld'를 공부하며 적은 기록입니다.

오늘 읽은 부분

2. The Optimal Django Environment Setup

  • 전 하위 목차

기억해야할 부분

2.1 같은 DB 엔진을 사용하자

  • local이나 production에서도
  • production 데이터의 똑같은 copy를 local에서 검증할 수가 없다
  • DB가 다르면 field type이나 constraints도 다르다.
  • SQLite3은 dynamic하고 weak typing
  • Django ORM이 내가 쓴 코드가 SQLite3와 more strongly typed manner로 상호작용하게 하지만
  • form과 model 검증은 production server에서 코드가 실행될 때까진 확신할 수 없다.

2.2 Use Pip and Virtualenv

  • 팁! virtualenvwrapper을 쓰면 virtualenv를 activate하는 수고가 덜어짐

2.4 Use a Version Control System (git, Mercurial 같은)

2.5.1 Vagrant and VirtualBox

  • 팁! using isolated docker containers