본격적으로 시작하기 위해 회원관리를 위한 accountapp을 만들어 앞으로 만들모든 app의 뼈대를 잡는다.
<모든 app개발 순서>
python manage.py startapp 앱이름
pinterest_clone/settings.py의 installed_app에 앱이름 추가
pinterest_clone/urls.py에 분기할 라우팅 경로 추가
앱이름 폴더에 urls.py 파일만들어서 app_name과 urlpatterns 추가
view.py와 models.py에 내용 추가
template 추가
1. 앱 만들기
터미널에 python manage.py startapp accountapp을 실행한다.
2. pinterest_clone /settings.py, pinterest_clone/urls.py에 분기할 라우팅경로 추가
![]() |
![]() |
3. accountapp/urls.py 만들어서 분기할 경로 추가: path(분기할경로, 사용할 클래스or함수, 이름)
4. accountapp/views.py에 urls.py에 사용될 view추가: request받으면 'success : request' 돌려주는 함수 작성
5. python manage.py runserver를 통해서 success: request가 나오는지 확인(완료)
- url -> 127.0.0.1:8000/accounts/home
5. templates/base.html 만들어서 views에서 사용될 html파일 추가
6. pinterest_clone/settings.py의 templates부분에 경로 지정
7. accountapp/views.py 수정
![]() |
![]() |
![]() |
![]() |
5. html파일 추가 | settings에 templates 경로 지정 | 7. 생성한 폴더에서 받아오게 render사용 |
8. render한 결과(완료)
'FrameWork > pinterest clone' 카테고리의 다른 글
5. 기초 스타일링(1) (0) | 2023.07.19 |
---|---|
4. 뼈대만들기2 (0) | 2023.07.17 |
2. 앱 시작 (0) | 2023.07.15 |
1. pinterest 구조 살펴보기 (0) | 2023.07.15 |
0.시작 (0) | 2023.07.10 |