File tree 6 files changed +126
-5
lines changed
6 files changed +126
-5
lines changed Original file line number Diff line number Diff line change
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ default_language_version :
4
+ python : python3.11
5
+ default_stages : [pre-commit, pre-push]
6
+ repos :
7
+ - repo : https://github.com/pre-commit/pre-commit-hooks
8
+ rev : v4.5.0
9
+ hooks :
10
+ - id : check-json
11
+ - id : check-toml
12
+ - id : check-xml
13
+ - id : check-yaml
14
+ - id : check-added-large-files
15
+ - id : detect-aws-credentials
16
+ - id : detect-private-key
17
+ - id : end-of-file-fixer
18
+ - id : mixed-line-ending
19
+ - id : pretty-format-json
20
+ - id : trailing-whitespace
21
+ exclude_types :
22
+ - javascript
23
+ - markdown
24
+ - repo : https://github.com/PyCQA/flake8
25
+ rev : 7.0.0
26
+ hooks :
27
+ - id : flake8
28
+ additional_dependencies :
29
+ - flake8-bugbear
30
+ - flake8-noqa
31
+ args :
32
+ - --max-line-length=120
33
+ - --max-complexity=18
34
+ - repo : https://github.com/psf/black
35
+ rev : 24.3.0
36
+ hooks :
37
+ - id : black
38
+ language_version : python3.11
39
+ args :
40
+ - --line-length=120
41
+ - repo : https://github.com/PyCQA/bandit
42
+ rev : ' 1.7.8'
43
+ hooks :
44
+ - id : bandit
45
+ - repo : https://github.com/PyCQA/isort
46
+ rev : ' 5.13.2'
47
+ hooks :
48
+ - id : isort
49
+ - repo : https://github.com/pre-commit/mirrors-mypy
50
+ rev : ' v1.9.0'
51
+ hooks :
52
+ - id : mypy
53
+ args :
54
+ - --no-strict-optional
55
+ - --ignore-missing-imports
56
+ - --check-untyped-defs
57
+ - --disallow-untyped-defs
58
+ - --disallow-incomplete-defs
59
+ - --disallow-untyped-calls
60
+ - repo : https://github.com/dosisod/refurb
61
+ rev : v2.0.0
62
+ hooks :
63
+ - id : refurb
Original file line number Diff line number Diff line change
1
+ # Setup development environment
2
+ setup :
3
+ poetry install
4
+
5
+ # Devtools
6
+ hooks-install : setup
7
+ poetry run pre-commit install
8
+
9
+ hooks-upgrade :
10
+ poetry run pre-commit autoupdate
11
+
12
+ hooks-lint :
13
+ poetry run pre-commit run --all-files
14
+
15
+ lint : hooks-lint # alias
16
+
17
+ hooks-mypy :
18
+ poetry run pre-commit run mypy --all-files
19
+
20
+ mypy : hooks-mypy # alias
Original file line number Diff line number Diff line change
1
+ # PyCon Korea API Server (2024 ~ )
2
+
3
+ ## 1. 로컬 개발 환경 설정
4
+ 본 프로젝트는 Python3.11 (또는 이후 버전)과 Poetry를 사용합니다.
5
+ - Poetry 설치는 [ 여기] ( https://python-poetry.org/docs/ ) 에서 확인해주세요.
6
+
7
+ ### 1.1. 프로젝트 설치
8
+ ``` bash
9
+ poetry install
10
+ ```
11
+
12
+ ### 1.2. pre-commit hook 설정
13
+ 본 프로젝트에서는 코딩 컨벤션을 준수하기 위해 [ pre-commit] ( https://pre-commit.com/ ) 을 사용합니다.
14
+ pre-commit을 설치하려면 다음을 참고해주세요.
15
+
16
+ #### 1.2.1. Linux / macOS
17
+ ``` bash
18
+ # 설치
19
+ make hooks-install
20
+
21
+ # 프로젝트 전체 코드 lint 검사 & format
22
+ make lint
23
+
24
+ # 프로젝트 전체 코드에 대해 mypy 타입 검사
25
+ make mypy
26
+ ```
27
+
28
+ #### 1.2.2. Windows
29
+ ``` bash
30
+ # 설치
31
+ poetry run pre-commit install
32
+
33
+ # 프로젝트 전체 코드 lint 검사 & format
34
+ poetry run pre-commit run --all-files
35
+
36
+ # 프로젝트 전체 코드에 대해 mypy 타입 검사
37
+ poetry run pre-commit run mypy --all-files
38
+ ```
Original file line number Diff line number Diff line change 4
4
import sys
5
5
6
6
7
- def main ():
7
+ def main () -> None :
8
8
"""Run administrative tasks."""
9
9
os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "pyconkr.settings" )
10
10
try :
Original file line number Diff line number Diff line change 20
20
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
21
21
22
22
# SECURITY WARNING: keep the secret key used in production secret!
23
- SECRET_KEY = "django-insecure-kjtg@&v106jt2wz9tlci@b!3uqrig7eud^3zk53&!me@gw_(q@"
23
+ SECRET_KEY = "django-insecure-kjtg@&v106jt2wz9tlci@b!3uqrig7eud^3zk53&!me@gw_(q@" # nosec: B105
24
24
25
25
# SECURITY WARNING: don't run with debug turned on in production!
26
26
DEBUG = True
27
27
28
- ALLOWED_HOSTS = []
28
+ ALLOWED_HOSTS : list [ str ] = []
29
29
30
30
31
31
# Application definition
54
54
TEMPLATES = [
55
55
{
56
56
"BACKEND" : "django.template.backends.django.DjangoTemplates" ,
57
- "DIRS" : [BASE_DIR / 'templates' ]
58
- ,
57
+ "DIRS" : [BASE_DIR / "templates" ],
59
58
"APP_DIRS" : True ,
60
59
"OPTIONS" : {
61
60
"context_processors" : [
Original file line number Diff line number Diff line change 14
14
1. Import the include() function: from django.urls import include, path
15
15
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16
16
"""
17
+
17
18
from django .contrib import admin
18
19
from django .urls import path
19
20
You can’t perform that action at this time.
0 commit comments