From 52283e334153572e1fa5a5d1f035b265d1bc2655 Mon Sep 17 00:00:00 2001 From: SaenalB Date: Mon, 2 Feb 2026 16:30:24 +0900 Subject: [PATCH] create directories and add files completed up to date --- saenal/exp_diary/Study_diary_03_Git.md | 187 ++++++++++++++++++ saenal/exp_mission/01-HTML-CSS/index.html | 65 ++++++ saenal/exp_mission/01-HTML-CSS/style.css | 65 ++++++ .../01-HTML-CSS/style_responsive.css | 107 ++++++++++ .../02-Python-Django/Task1_code_urls.py | 24 +++ .../02-Python-Django/Task1_code_views.py | 26 +++ .../02-Python-Django/Task2_code_admin.py | 5 + .../02-Python-Django/Task2_code_models.py | 14 ++ .../02-Python-Django/Task3_code_app_urls.py | 6 + .../Task3_code_project_urls.py | 25 +++ .../Task3_code_serializers.py | 7 + .../02-Python-Django/Task3_code_views.py | 43 ++++ .../02-Python-Django/Task4_code_urls.py | 10 + .../02-Python-Django/Task4_code_views.py | 9 + .../02-Python-Django/Task5_code_urls.py | 42 ++++ 15 files changed, 635 insertions(+) create mode 100644 saenal/exp_diary/Study_diary_03_Git.md create mode 100644 saenal/exp_mission/01-HTML-CSS/index.html create mode 100644 saenal/exp_mission/01-HTML-CSS/style.css create mode 100644 saenal/exp_mission/01-HTML-CSS/style_responsive.css create mode 100644 saenal/exp_mission/02-Python-Django/Task1_code_urls.py create mode 100644 saenal/exp_mission/02-Python-Django/Task1_code_views.py create mode 100644 saenal/exp_mission/02-Python-Django/Task2_code_admin.py create mode 100644 saenal/exp_mission/02-Python-Django/Task2_code_models.py create mode 100644 saenal/exp_mission/02-Python-Django/Task3_code_app_urls.py create mode 100644 saenal/exp_mission/02-Python-Django/Task3_code_project_urls.py create mode 100644 saenal/exp_mission/02-Python-Django/Task3_code_serializers.py create mode 100644 saenal/exp_mission/02-Python-Django/Task3_code_views.py create mode 100644 saenal/exp_mission/02-Python-Django/Task4_code_urls.py create mode 100644 saenal/exp_mission/02-Python-Django/Task4_code_views.py create mode 100644 saenal/exp_mission/02-Python-Django/Task5_code_urls.py diff --git a/saenal/exp_diary/Study_diary_03_Git.md b/saenal/exp_diary/Study_diary_03_Git.md new file mode 100644 index 0000000..20b7a50 --- /dev/null +++ b/saenal/exp_diary/Study_diary_03_Git.md @@ -0,0 +1,187 @@ +# Git + +1. [Git의 의미, 목적, 기능](#1-git의-의미-목적-기능) +2. [용어 정리 및 기본 사용법](#2-용어-정리-및-기본-사용법) +3. [GitHub](#3-github) +4. [명령어 정리](#4-명령어-정리) +5. [추가 학습 사항](#5-추가-학습-사항) + +***** + +### 1. Git의 의미, 목적, 기능 + (1) 필요성 : 버전 관리(Version Control System), 버그/장애 검증 및 복구, 협업 보조
+ (2) 기능 : 변경 이력 기록, 추적, 복원
+ (3) 방법 + - 특정 시점의 파일 시스템을 스냅샷으로 기록 + - tree 상태(프로젝트 구조 및 파일 수정 사항), 메타 정보(작성자, 시간, 메시지), 히스토리 + - 기존 버전 관리는 중앙집중식(CVCS) Git은 분산식(DVCS) + - Git : commit 관리, 인터넷 없이 local에서만도 기능 + - Github : 저장소 공유 플랫폼, PR, 리뷰, 이슈, CI/CD 가능 + +[top](#git) + +### 2. 용어 정리 및 기본 사용법 + - checksum : git의 기본 데이터 단위. SHA-1 해시값. 무결성 검사(데이터 변조 혹은 유실 체크) + - repository + - 영역 + - git directory (.git) + - staging area (.git\index) + - working directory + - 파일 상태 + + + + + + + + + + + + + + +
untrackedtracked
committed
staged
modified
+ + - 기본 흐름 : (checkout >) modify > stage > commit (>merge) + - .gitignore + - 이 파일에서 설정한 규칙에 해당하는 파일들은 변경이 있어도 트래킹 X + - 작성 규칙 : glob 패턴 ([참고](https://jw910911.tistory.com/136#google_vignette)) + - branch : 어느 commit 지점을 가리키는 포인터(reference) + - ex. main or master, feature + - 사용 예. feature branch 생성 > 수정, commit > main branch에 merge + - 효과 : merge 전 테스트 가능, 협업 시 서로 다른 이슈를 동시에 여러 사람이 작업하기에 용이 + - HEAD : 현재 내가 보고 있는 포인터. 현재 checkout 한 브랜치. 새 commit이 생기면 이동 + - \*tag : realease 할 때 사용. 필요 시 push할 때 명시해야 함. + - merge : 한 브랜치에서 commit한 내용을 다른 브랜치와 통합 + - fast-forward merge(직선형) vs. 3-way merge(공통 조상인 commit 이용) + - conflict : 서로 다른 브랜치에서 같은 부분을 수정하여 merge 실패
+ \> 충돌한 부분을 직접 수정, commit > merge continue + - stash : commit 하지 않고 임시 저장한 채로 checkout 가능 + - rebase : commit 이력을 선형으로 정리 (공개된 repo에 pussh 된 commit은 rebase 주의) + - reset : commit 후 push 전 상태에서 HEAD/Index(staged)/Working directory 중 어느 단계로 되돌리기. soft/mixed/hard 중 선택. reset 히스토리는 남지 않음 + - revert : 특정 commit으로 되돌리되, revert commit이 히스토리에 남음. 실수가 이미 공유되었을 때 사용. + - merge commit은 어떤 부모(mainline)로 되돌릴지 선택해야 함 + - revert commit을 다시 revert 가능 + +[top](#git) + +### 3. GitHub + - github에 repo 생성(원격, remotes/origin/...), 로컬과 연결하여 추적, 원격>로컬 복제, 로컬>원격 push + - 브랜치 관리 전략 : git flow vs. github flow
+ \> 프로젝트 특성, 팀 성격에 따라 (릴리즈 주기, 버전 관리, 안정성 등) + - PR : Pull Request. 수정 내용 설명, 검증, 리뷰, 합의 후 merge 가능 + - fork : 오픈소스를 내 github repo(origin)에 fork > 로컬에 clone > 수정, 내 repo에 push > upstream(원 소스)에 PR >> push 불가, PR 가능, upstream 추적 가능 + - collaborator + - 토큰 + - organization + - 문제 상황 ex. + - feature branch보다 main branch가 앞설 때 + - hotfix 필요 + - commit 실수 (; 파일 누락) + - 실수가 이미 공유됨(pushed) + - Github Actions + - CI/CD : Continuous Integration + Continuous Deployment 지속적 병합, 지속적 배포. ex. Jenkins, ArgoCD, Gitlab 등 + - 설정해둔 조건(PR, push 등)에 따라 자동 검증(test) 및 배포(AWS, Azure, GCP, Kubernetes, App Service, Container Service, On-prem server, Google Cloud etc.) + - 구성 요소 + - workflow : 전체 자동화 시나리오. 한 repo 안에 여러 workflow 파일을 두고 역할별로 사용. 하나 이상의 job들로 구성된 YAML(.yml) 파일 + - event : 실행 조건, 트리거. push, PR, 스케줄 등으로 설정 또는 수동으로 실행. 브랜치를 한정하여 설정 가능 (on:) + - job : 실행 단위. 한 대의 runner에서 실행 + - runner : job을 실행시키는 머신, github 제공 또는 사용자 직접 운영(내부망 대상 배포 시) (runs-on:) + - step : 명령어 단위(한 줄/스크립트) + - action : 기성품..패키지 같은 것.. (uses:) + - script/command : (run:) + - [YAML syntax](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax) + - CD 패턴 : build/test(CI) > artifact 생성 or container image 생성 > registry 업로드 > deploy 대상에 반영 > 상태 기록 (+알림) + - CD 인증 : 배포 대상에 접근 위해 키나 토큰 등 필요 + +[top](#git) + +### 4. 명령어 정리 + - (설정) + - git config : 기본 설정 + - \--global user.name "user name" + - \--global user.email "email\@address" + - git init + - (브랜치) + - git branch : 현재 존재하는 브랜치 확인 + - \* main 또는 master 브랜치 하나만 존재할 때는 출력 내용 없음 + - 기본 또는 -l : 로컬 브랜치만 + - \-r : 원격 브랜치만 + - \-a : 모든 브랜치 + - \-v : 마지막 commit checksum과 commit message 함께 표시 + - \-vv : 어떤 로컬 브랜치가 어떤 원격 브랜치를 추적하는지 + diff 확인 + - git branch \[branch name] : 새 브랜치 생성 + - \-d : 삭제 (아직 merge 하지 않은 commit 있으면 삭제 불가 >> 강제 삭제 옵션 -D) + - \-m \[원래 이름] \[새 이름] : 이름 변경 (덮어쓰기 옵션 -M) + - \* 브랜치 생성/변경/삭제 후 push 해야만 원격에 반영 (git push \[remote branch] \[local branch]) + - git switch \[branch name] + - \-c : 새 브랜치 만들고 바로 이동 + - git checkout \[branch name] + - \-b : 새 브랜치 만들고 바로 이동 + - git checkout \[local branch(A)] \[remote branch(B)] : A가 B를 추적하게 함 + - git checkout -t \[remote branch] + - (commit 관리) + - git status + - \-s / \--short + - git log + - -p / --patch : diff 결과 + - \--stat + - \--oneline + - \--graph + - \--short + - \--full + - \--fuller + - \--format + - \-S \[text] : "text"가 변경 내용에 포함되어 있는지 탐색 + - git diff : unstaged 파일의 변경 사항 확인 + - git add \[file name] : 변경 사항을 staging area에 올림 + - git commit + - \-m \[commit message] + - \-a : staging area 생략 (add + commit) + - \--amend : 마지막 commit 수정 (파일 추가, 커밋 메시지 수정) + - git rebase \[main/master] : feature branch에서 실행!! + - git stash (save) "message" : 해당 브랜치의 변경 사항 임시 저장 + - git stash push -m "message" + - \-u : untracked 파일 포함 + - list : stash 목록 확인 + - show : 변경된 파일 확인 + - show -p : 변경 내용 상세 확인 + - apply stash@{n} : 스택에 남긴 채로 불러오기 (stash index 미지정 시 가장 최근 것) + - pop stash@{n} : 스택에서 지우고 불러오기 (stash index 미지정 시 가장 최근 것) + - drop stash@{n} : 해당 stash 삭제 + - clear : stash stack 전체 삭제 + - git reset + - \--soft HEAD~n : 최신부터 n개 커밋 취소하고 staged 상태로 + - \--mixed HEAD~n : 최신부터 n개 커밋 취소하고 modified 상태로 (working directory는 그대로) + - \--hard HEAD~n : 최신부터 n개 커밋 취소하고 변경 내역도 모두 취소 + - HEAD~n 또는 HEAD^ (^의 개수만큼 이전으로) + - 파일 특정하여 reset 가능 + - git restore \[filename] + - \--staged : modified 상태로 되돌리기(unstaged) + - git revert \[checksum] + - (원격) + - git remote : 등록된 원격 저장소 확인 + - git remote add \[remote branch] \[URL] : 연결 후 push + - \-v : 이름 및 URL 확인 + - git remote rename \[이전 이름] \[새 이름] + - git remote remove \[삭제할 원격 브랜치] + - git clone \[URL] + - git fetch \[remote branch] : 원격에서 로컬로 복사(X merge) + - git pull \[remote branch] : fetch + merge + - git push \[remote branch] \[local branch] + - \-u \[remote branch] \[local branch] 또는 \--set-upstream : 두 브랜치를 트래킹 설정하여 이후 "git push" 명령어만으로 자동 push + - git tag + - 기본 : 조회 + - git tag \[tag] : checksum 저장. 임시로 메타정보 없이 저장 + - \-a \[tag] : 메타정보(작성자, 날짜, 태그 메시지) 함께 저장 + - git push \[remote branch] \[tag] : push는 기본적으로 태그는 전송하지 않으므로 원할 때 명시해야 함 + - git checkout \[tag] : 가져오기 + +[top](#git) + +### 5. 추가 학습 사항 +- Remote Refs vs. Remote-tracking branch +- stash를 이용하면 한 branch 내에서 여러 버전 만들고 최종적으로 무엇을 commit할 지 결정해서 가는 것도 가능?? +- 오픈소스 (ex.github actions의 action) 사용할 때 원 소스가 변경되면...? diff --git a/saenal/exp_mission/01-HTML-CSS/index.html b/saenal/exp_mission/01-HTML-CSS/index.html new file mode 100644 index 0000000..d006d5d --- /dev/null +++ b/saenal/exp_mission/01-HTML-CSS/index.html @@ -0,0 +1,65 @@ + + + + Resume + + + + + + +
이   력   서
+
+

한 줄 소개를 넣어봅시다

+
+
+
+ +

방 새 날

+

Saenal Bhang

+

클라우드 네이티브 엔지니어
(신입)

+

010-5812-2271

+

saenalb@gmail.com

+ +
+
+
+
Education
+
    +
  • 2007.03 ~ 2010.03 0000학교 졸업
  • +
  • 2010.03 ~ 2015.08 000학교 0000학과
  • +
  • 2023.03 ~ 2026.00 000000000학교 0000학부
  • +
  • 2025.12 ~ 2026.07 부트캠프 구름톤 딥다이브 '클라우드 네이티브 엔지니어링 개발자 과정' 수료
  • +
+
+
+
Experience
+
    +
  • 2022.04 ~ 2023.04 (주)000000 000000 담당
  • +
  • 2023.11 ~ 2024.10 (주)0000 000 담당
  • +
+
+
+
Skills
+
    +
  • HTML5/CSS
  • +
  • Python
  • +
  • AWS
  • +
  • Docker&Kubernetes
  • +
+
+
+
Portfolio
+ +
+
+ + \ No newline at end of file diff --git a/saenal/exp_mission/01-HTML-CSS/style.css b/saenal/exp_mission/01-HTML-CSS/style.css new file mode 100644 index 0000000..e34c988 --- /dev/null +++ b/saenal/exp_mission/01-HTML-CSS/style.css @@ -0,0 +1,65 @@ +body { + margin: 30px; + font-family: "Noto-Serif-KR", Arial, sans-serif, system-ui; + width: 80%; + max-width: 1024px; + justify-self: center; +} + +header { + text-align: center; + font-size: 40px; + font-weight: bold; +} + +p { + margin: 0; +} + +.introduction { + margin-top: 5px; + justify-self: center; +} + +.line { + margin: 10px; + border: 3px solid #c5e6f1b2; + border-radius: 50px; +} + +.profile { + border-radius: 30px; + padding: 20px; + background: #cdf2fe99; + display: flex; + flex-direction: column; + align-items: center; + gap: 10px; + text-align: center; + position: relative; +} + +.section { + margin: 10px; + padding: 5px; +} + +.sct_head { + font-family: "Orbit"; + color: blue; + font-size: 25px; +} + +li::marker { + color: skyblue; +} + +#pf-img { + width: 100px; + border-radius: 200px; + object-fit: cover; +} + +.link-img { + width: 40px; +} diff --git a/saenal/exp_mission/01-HTML-CSS/style_responsive.css b/saenal/exp_mission/01-HTML-CSS/style_responsive.css new file mode 100644 index 0000000..210efaa --- /dev/null +++ b/saenal/exp_mission/01-HTML-CSS/style_responsive.css @@ -0,0 +1,107 @@ +body { + margin: 30px; + font-family: "Noto-Serif-KR", Arial, sans-serif, system-ui; + width: 80%; + max-width: 1024px; + display: grid; + justify-self: center; + grid-template-areas: + "header header" + "intro intro" + "line line" + "profile sections"; + grid-template-rows: 50px 30px 3px 4fr; + grid-template-columns: 1fr 3fr; + row-gap: 20px; + column-gap: 30px; +} + +header { + grid-area: header; + text-align: center; + font-size: 40px; + font-weight: bold; +} + +p { + margin: 0; +} + +.introduction { + grid-area: intro; + justify-self: center; + margin-top: 5px; +} + +.line { + grid-area: line; + border: 3px solid #c5e6f1b2; + border-radius: 50px; +} + +.profile { + grid-area: profile; + border-radius: 30px; + padding: 20px; + background: #cdf2fe99; + display: flex; + flex-direction: column; + align-items: center; + gap: 10px; + text-align: center; + position: relative; +} + +.links { + position: absolute; + bottom: 15px; + /**/ +} + +.sections { + grid-area: sections; +} + +.section { + margin: 10px; + padding: 5px; +} + +.sct_head { + font-family: "Orbit"; + color: blue; + font-size: 25px; +} + +li::marker { + color: skyblue; +} + +#pf-img { + width: 80%; + border-radius: 200px; + object-fit: cover; +} + +.link-img { + width: 40px; +} + +/*화면 크기별 반응형 레이아웃 적용*/ +@media (max-width: 768px) { + body { + grid-template-areas: + "header" + "intro" + "line" + "profile" + "sections"; + grid-template-columns: 1fr; + } + + #pf-img { + width: 30%; + height: 40%; + border-radius: 20px 40px; + } +} \ No newline at end of file diff --git a/saenal/exp_mission/02-Python-Django/Task1_code_urls.py b/saenal/exp_mission/02-Python-Django/Task1_code_urls.py new file mode 100644 index 0000000..e97c274 --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task1_code_urls.py @@ -0,0 +1,24 @@ +""" +URL configuration for hello project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/6.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include +from sayhello import views + +urlpatterns = [ + path('admin/', admin.site.urls), + path('sayhello/', views.index), +] diff --git a/saenal/exp_mission/02-Python-Django/Task1_code_views.py b/saenal/exp_mission/02-Python-Django/Task1_code_views.py new file mode 100644 index 0000000..71a0acd --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task1_code_views.py @@ -0,0 +1,26 @@ +from django.shortcuts import render +from django.http import HttpResponse + +# Create your views here. +def index(request): + html_content = """ + + + Hello + + + +
+

Hello Django !!

+
+ + + """ + return HttpResponse(html_content) diff --git a/saenal/exp_mission/02-Python-Django/Task2_code_admin.py b/saenal/exp_mission/02-Python-Django/Task2_code_admin.py new file mode 100644 index 0000000..d4dd1ff --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task2_code_admin.py @@ -0,0 +1,5 @@ +from django.contrib import admin +from .models import Article + +# Register your models here. +admin.site.register(Article) \ No newline at end of file diff --git a/saenal/exp_mission/02-Python-Django/Task2_code_models.py b/saenal/exp_mission/02-Python-Django/Task2_code_models.py new file mode 100644 index 0000000..0dcdd91 --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task2_code_models.py @@ -0,0 +1,14 @@ +from django.db import models +from django.contrib.auth.models import User + +# Create your models here. +class Article(models.Model): + title = models.CharField(max_length=100) + content = models.TextField() + author = models.ForeignKey(User, on_delete=models.CASCADE, related_name='articles') + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + is_published = models.BooleanField(default=False) + + def __str__(self): + return self.title \ No newline at end of file diff --git a/saenal/exp_mission/02-Python-Django/Task3_code_app_urls.py b/saenal/exp_mission/02-Python-Django/Task3_code_app_urls.py new file mode 100644 index 0000000..e956ad3 --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task3_code_app_urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from .views import ArticleView + +urlpatterns = [ + path('', ArticleView.as_view(), name='ArticleAPIView'), +] diff --git a/saenal/exp_mission/02-Python-Django/Task3_code_project_urls.py b/saenal/exp_mission/02-Python-Django/Task3_code_project_urls.py new file mode 100644 index 0000000..9491d42 --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task3_code_project_urls.py @@ -0,0 +1,25 @@ +""" +URL configuration for hello project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/6.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include +from sayhello import views + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', views.index), + path('article/', include('sayhello.urls')), +] diff --git a/saenal/exp_mission/02-Python-Django/Task3_code_serializers.py b/saenal/exp_mission/02-Python-Django/Task3_code_serializers.py new file mode 100644 index 0000000..8769ee2 --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task3_code_serializers.py @@ -0,0 +1,7 @@ +from rest_framework import serializers +from .models import Article + +class ArticleSerializer(serializers.ModelSerializer): + class Meta: + model = Article + fields = '__all__' diff --git a/saenal/exp_mission/02-Python-Django/Task3_code_views.py b/saenal/exp_mission/02-Python-Django/Task3_code_views.py new file mode 100644 index 0000000..2197e4a --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task3_code_views.py @@ -0,0 +1,43 @@ +from django.shortcuts import render +from django.http import HttpResponse +from rest_framework.views import APIView +from rest_framework.response import Response +from .serializers import ArticleSerializer +from .models import Article + +# Create your views here. +def index(request): + html_content = """ + + + Hello + + + +
+

Hello Django !!

+
+ + + """ + return HttpResponse(html_content) + +class ArticleView(APIView): + def get(self, request): + articles = Article.objects.all() + serializer = ArticleSerializer(articles, many=True) + return Response(serializer.data) + + def post(self, request): + serializer = ArticleSerializer(data=request.data) + if serializer.is_valid(): + serializer.save() + return Response(serializer.data, status=201) + return Response(serializer.errors, status=400) diff --git a/saenal/exp_mission/02-Python-Django/Task4_code_urls.py b/saenal/exp_mission/02-Python-Django/Task4_code_urls.py new file mode 100644 index 0000000..ad0aab0 --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task4_code_urls.py @@ -0,0 +1,10 @@ +from django.urls import path, include +from rest_framework import routers +from .views import ArticleViewSet + +router = routers.DefaultRouter() +router.register(r'articles', ArticleViewSet) + +urlpatterns = [ + path('', include(router.urls)), +] \ No newline at end of file diff --git a/saenal/exp_mission/02-Python-Django/Task4_code_views.py b/saenal/exp_mission/02-Python-Django/Task4_code_views.py new file mode 100644 index 0000000..77d0f46 --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task4_code_views.py @@ -0,0 +1,9 @@ +from django.shortcuts import render +from rest_framework import viewsets +from .serializers import ArticleSerializer +from .models import Article + +# Create your views here. +class ArticleViewSet(viewsets.ModelViewSet): + queryset = Article.objects.all() + serializer_class = ArticleSerializer diff --git a/saenal/exp_mission/02-Python-Django/Task5_code_urls.py b/saenal/exp_mission/02-Python-Django/Task5_code_urls.py new file mode 100644 index 0000000..6fcdd05 --- /dev/null +++ b/saenal/exp_mission/02-Python-Django/Task5_code_urls.py @@ -0,0 +1,42 @@ +""" +URL configuration for hello project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/6.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include +from sayhello import views +from rest_framework import permissions +from drf_yasg.views import get_schema_view +from drf_yasg import openapi + +schema_view = get_schema_view( + openapi.Info( + title="Articles API", + default_version="v1", + description="Swagger Docs for Articles API", + terms_of_service="https://www.google.com/policies/terms/", + contact=openapi.Contact(name="test", email="test@test.com"), + license=openapi.License(name="Test License"), + ), + public=True, + permission_classes=(permissions.AllowAny,), +) + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', views.index), + path('articleapp/', include('articleapp.urls')), + path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), +]