API
[django] Playing with the API
[django] Playing with the API
2015. 7. 13.Playing with the API 단순히 "python"이라고 입력하는 대신에, 앞으로는 아래와 같이 사용할 것이다.왜냐하면 manage.py 가DJANGO_SETTINGS_MODULE 환경변수(mysite/settings.py file 의 경로를 가져온다)를 설정해주는 역할을 하기 때문이다. $ python manage.py shell아래와 같이 DJANGO_SETTINGS_MODULE 환경 변수를 직접 설정하는 방법도 있다.>>> import django >>> django.setup()manage.py 파일이 위치한 디렉토리에서 파이썬을 실행해야 한다.더욱 자세한 내용은 django-admin 문서에서 확인가능하다.이제 그러면 데이터베이스 API 를 살펴보자. # 방금 작성한 모델 클래스를 가져..