Flower in my dev/Django

<DJANGO>[Hello World]

꽃선생 2017. 3. 5. 22:24

[Hello World]


안하면 이상한 찝찝한 과정...


1. 프로젝트 생성

- django-admin startproject [프로젝트명]

- cd [프로젝트명]


2. 앱 생성

- python3 manage.py startapp [앱명]


3. static, media, templates 디렉토리 생성

- mkdir static

- mkdir media

- mkdir templates


4. 기본 구조

- 프로젝트

- 기본앱


5. 프로젝트 디렉토리에서 django 설정

- settings.py


- urls.py


6. app 구조

- urls.py가 없을 경우 생성


7. app001/urls.py


8. app/views.py

- render와 render_to_response의 차이

https://jwkcp.github.io/2017/02/22/wtdb-render-render-to-response/


9. templates/hello_world.html


10. 서버 실행

- python3 manage.py runserver localhost:8080

- django는 웹서버를 제공하는데 테스트용으로 사용하자.


11. Hello World 확인

- localhost:8080/app001/

- django 웹서버 로그


긴 여정이 될 것 같지만 천천히 가보도록 하자~~~