├── example
└── chapter1
│ ├── 1-1_self_intro.py
│ ├── 1-2_find_num.py
│ ├── 1-3_remove_num.py
│ ├── 1-4_counting_character.py
│ └── 1-5_using_pandas.py
├── project
├── Django-PracticeProject
│ ├── error_init.html
│ ├── index_init.html
│ ├── login_init.html
│ ├── signup_init.html
│ ├── uploadFile_init.html
│ ├── verifyCode_init.html
│ └── verifyGood_init.html
├── ExcelCalculate
│ ├── data.xlsx
│ ├── index_init.html
│ ├── result_init.html
│ ├── signin_init.html
│ ├── signup_init.html
│ └── verifyCode_init.html
├── RestaurantShare
│ ├── categoryCreate_init.html
│ ├── index_init.html
│ ├── restaurantCreate_init.html
│ └── restaurantDetail_init.html
├── ToDoList
│ └── index_init.html
└── install_check_project
│ ├── install_check_project
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
│ └── manage.py
└── readme.md
/example/chapter1/1-1_self_intro.py:
--------------------------------------------------------------------------------
1 | # 1-1_self_intro.py
2 | name = "문범우"
3 | age = 26
4 | school = "서울 소재의 대학교"
5 | job = "개발자"
6 | dream = "많은 사람들이 코딩을 즐길 수 있도록 기여하는 것"
7 | say_hello = "안녕하세요!"
8 | say_goodbye = "잘 부탁드립니다 :)"
9 |
10 | print(say_hello,name+"입니다.")
11 | print("저는",school+"를 졸업하고 현재는 "+job,end='')
12 | # end를 활용하여 print문 이후 자동 줄바꿈을 컨트롤 할 수 있다.
13 | print("로 일하고 있습니다.\n다양한 꿈이 있지만 그 중 하나는\n'"+dream+"' 입니다.")
14 | print('그럼',say_goodbye)
--------------------------------------------------------------------------------
/example/chapter1/1-2_find_num.py:
--------------------------------------------------------------------------------
1 | # 1-2_find_num.py
2 | def solution(input_str):
3 | # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
4 | # Write your code here.
5 | answer = ""
6 | for i in range(10):
7 | if str(i) in input_str:
8 | pass
9 | else:
10 | answer = str(i)
11 | break
12 |
13 | return answer
14 | # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
15 |
16 | input_str1 = "012345678"
17 | input_str2 = "483750219"
18 | input_str3 = "242810485760109726496"
19 | print(solution(input_str1)+", "+solution(input_str2)+", "+solution(input_str3))
--------------------------------------------------------------------------------
/example/chapter1/1-3_remove_num.py:
--------------------------------------------------------------------------------
1 | # 1-3_remove_num.py
2 | def solution(input_str):
3 | # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
4 | # Write your code here.
5 | answer = ""
6 | number_list = ['0','1','2','3','4','5','6','7','8','9']
7 | # 또는 아래와 같이 map함수를 이용하여 number_list를 만들 수 있습니다.
8 | # number_list = list(map(str,range(10)))
9 |
10 | for i in input_str:
11 | if i in number_list:
12 | pass
13 | else:
14 | answer += i
15 |
16 | return answer
17 | # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
18 |
19 | input_str1 = "H123e4l5l6o7, P8y9t1h2o3n.4"
20 | input_str2 = "6L11if3e 4is 5to1o0 sh00or3t."
21 | input_str3 = "7Y3o7u n456ee2d5 6pyt9h5on2."
22 | print(solution(input_str1)+", "+solution(input_str2)+", "+solution(input_str3))
--------------------------------------------------------------------------------
/example/chapter1/1-4_counting_character.py:
--------------------------------------------------------------------------------
1 | # 1-4_counting_character.py
2 | def solution(input_str):
3 | # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
4 | # Write your code here.
5 | answer = ""
6 | input_dic = {}
7 | for i in input_str:
8 | if i in input_dic.keys():
9 | input_dic[i] += 1
10 | else:
11 | input_dic[i] = 1
12 | input_list = list(input_dic.keys())
13 | input_list.sort()
14 |
15 | for i in input_list:
16 | answer += i
17 | answer += str(input_dic[i])
18 |
19 | return answer
20 | # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
21 | input_str1 = "aaabbccd"
22 | input_str2 = "ffaafddde"
23 | input_str3 = "aabcdadbbfweeaddfadf"
24 | print(solution(input_str1), solution(input_str2), solution(input_str3))
--------------------------------------------------------------------------------
/example/chapter1/1-5_using_pandas.py:
--------------------------------------------------------------------------------
1 | # 1-5_using_pandas.py
2 | import pandas as pd
3 | def solution(df):
4 | # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
5 | # Write your code here.
6 | df['avg'] = (df['math']+df['science'])/2
7 | df['avg_high'] = df['avg']>2.5
8 | return df
9 | # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
10 |
11 | data = {"name": ["Moon", "Choi", "Song", "Jang"],
12 | "math": [4.0, 2.1, 4.7, 2.6],
13 | "science": [3.8, 1.7, 0.7, 2.4]}
14 | df = pd.DataFrame(data, columns=["name", "math", "science"])
15 | print(solution(df))
--------------------------------------------------------------------------------
/project/Django-PracticeProject/error_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
23 |
24 | 실전 프로젝트
25 |
26 |
27 |
28 |
33 |
34 |
에러가 발생했어요 :'(
35 |
36 |
에러 내용입니다.
37 |
38 |
Home
39 |
40 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/project/Django-PracticeProject/index_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
29 |
30 | 실전 프로젝트
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 | - File Name (2019/09/19 17:31:23)
45 |
46 |
47 |
48 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/project/Django-PracticeProject/login_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
22 |
23 | 실전 프로젝트
24 |
25 |
26 |
52 |
53 |
--------------------------------------------------------------------------------
/project/Django-PracticeProject/signup_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
26 |
38 | 실전 프로젝트
39 |
40 |
41 |
77 |
78 |
--------------------------------------------------------------------------------
/project/Django-PracticeProject/uploadFile_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
29 |
30 | 실전 프로젝트
31 |
32 |
33 |
34 |
39 |
40 |
파일 업로드
41 |
48 |
Home
49 |
50 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/project/Django-PracticeProject/verifyCode_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
22 |
23 | Excel Calculate
24 |
25 |
26 |
27 |
32 |
33 |
34 |
회원가입을 위해 입력하신 이메일로 인증코드를 보냈습니다.
35 |
이메일로 전송된 메일의 인증코드를 입력해주세요.
36 |
43 |
44 |
45 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/project/Django-PracticeProject/verifyGood_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
22 |
23 | Excel Calculate
24 |
25 |
26 |
27 |
32 |
33 |
34 |
인증이 정상적으로 완료되었습니다.
35 |
36 |
Home
37 |
38 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/project/ExcelCalculate/data.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/doorBW/Django_with_PracticeExamples/782b4c1b0e213d562df10868a12f0095620b12cd/project/ExcelCalculate/data.xlsx
--------------------------------------------------------------------------------
/project/ExcelCalculate/index_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
29 |
30 | Excel Calculate
31 |
32 |
33 |
54 |
55 |
--------------------------------------------------------------------------------
/project/ExcelCalculate/result_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
29 |
30 | Excel Calculate
31 |
32 |
33 |
34 |
40 |
41 |
42 |
* Excel 결과 확인 *
43 |
44 |
45 |
46 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/project/ExcelCalculate/signin_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
29 |
30 | Excel Calculate
31 |
32 |
33 |
34 |
42 |
43 |
44 |
안녕하세요. 로그인을 진행해주세요.
45 |
56 |
회원가입하기
57 |
58 |
59 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/project/ExcelCalculate/signup_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
33 |
45 | Excel Calculate
46 |
47 |
48 |
87 |
88 |
--------------------------------------------------------------------------------
/project/ExcelCalculate/verifyCode_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
29 |
30 | Excel Calculate
31 |
32 |
33 |
34 |
42 |
43 |
44 |
회원가입을 위해 입력하신 이메일로 인증코드를 보냈습니다.
45 |
이메일로 전송된 메일의 인증코드를 입력해주세요.
46 |
53 |
54 |
55 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/project/RestaurantShare/categoryCreate_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
54 |
59 | 맛집 추가하기
60 |
72 |
73 |
74 |
110 |
111 |
--------------------------------------------------------------------------------
/project/RestaurantShare/index_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
144 |
149 |
195 | 맛집 공유 사이트
196 |
197 |
198 |
307 |
308 |
--------------------------------------------------------------------------------
/project/RestaurantShare/restaurantCreate_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
54 |
59 | 맛집 추가하기
60 |
83 |
84 |
85 |
86 |
92 |
93 |
122 |
123 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/project/RestaurantShare/restaurantDetail_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
54 |
59 | 맛집 추가하기
60 |
83 |
84 |
85 |
121 |
122 |
--------------------------------------------------------------------------------
/project/ToDoList/index_init.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
32 |
33 | To-Do
34 |
35 |
36 |
37 |
42 |
43 |
44 |
52 |
53 |
54 |
55 |
66 |
67 |
68 |
69 |
70 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/project/install_check_project/install_check_project/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/doorBW/Django_with_PracticeExamples/782b4c1b0e213d562df10868a12f0095620b12cd/project/install_check_project/install_check_project/__init__.py
--------------------------------------------------------------------------------
/project/install_check_project/install_check_project/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for install_check_project project.
3 |
4 | Generated by 'django-admin startproject' using Django 2.2.1.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/2.2/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/2.2/ref/settings/
11 | """
12 |
13 | import os
14 |
15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 |
18 |
19 | # Quick-start development settings - unsuitable for production
20 | # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
21 |
22 | # SECURITY WARNING: keep the secret key used in production secret!
23 | SECRET_KEY = '3(cfa4v-i7_1(gka-p9vb59pe&)$cy@6gwa4g-q@h@j2xmou@('
24 |
25 | # SECURITY WARNING: don't run with debug turned on in production!
26 | DEBUG = True
27 |
28 | ALLOWED_HOSTS = []
29 |
30 |
31 | # Application definition
32 |
33 | INSTALLED_APPS = [
34 | 'django.contrib.admin',
35 | 'django.contrib.auth',
36 | 'django.contrib.contenttypes',
37 | 'django.contrib.sessions',
38 | 'django.contrib.messages',
39 | 'django.contrib.staticfiles',
40 | ]
41 |
42 | MIDDLEWARE = [
43 | 'django.middleware.security.SecurityMiddleware',
44 | 'django.contrib.sessions.middleware.SessionMiddleware',
45 | 'django.middleware.common.CommonMiddleware',
46 | 'django.middleware.csrf.CsrfViewMiddleware',
47 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
48 | 'django.contrib.messages.middleware.MessageMiddleware',
49 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
50 | ]
51 |
52 | ROOT_URLCONF = 'install_check_project.urls'
53 |
54 | TEMPLATES = [
55 | {
56 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
57 | 'DIRS': [],
58 | 'APP_DIRS': True,
59 | 'OPTIONS': {
60 | 'context_processors': [
61 | 'django.template.context_processors.debug',
62 | 'django.template.context_processors.request',
63 | 'django.contrib.auth.context_processors.auth',
64 | 'django.contrib.messages.context_processors.messages',
65 | ],
66 | },
67 | },
68 | ]
69 |
70 | WSGI_APPLICATION = 'install_check_project.wsgi.application'
71 |
72 |
73 | # Database
74 | # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
75 |
76 | DATABASES = {
77 | 'default': {
78 | 'ENGINE': 'django.db.backends.sqlite3',
79 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
80 | }
81 | }
82 |
83 |
84 | # Password validation
85 | # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
86 |
87 | AUTH_PASSWORD_VALIDATORS = [
88 | {
89 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
90 | },
91 | {
92 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
93 | },
94 | {
95 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
96 | },
97 | {
98 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
99 | },
100 | ]
101 |
102 |
103 | # Internationalization
104 | # https://docs.djangoproject.com/en/2.2/topics/i18n/
105 |
106 | LANGUAGE_CODE = 'en-us'
107 |
108 | TIME_ZONE = 'UTC'
109 |
110 | USE_I18N = True
111 |
112 | USE_L10N = True
113 |
114 | USE_TZ = True
115 |
116 |
117 | # Static files (CSS, JavaScript, Images)
118 | # https://docs.djangoproject.com/en/2.2/howto/static-files/
119 |
120 | STATIC_URL = '/static/'
121 |
--------------------------------------------------------------------------------
/project/install_check_project/install_check_project/urls.py:
--------------------------------------------------------------------------------
1 | """install_check_project URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/2.2/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.contrib import admin
17 | from django.urls import path
18 |
19 | urlpatterns = [
20 | path('admin/', admin.site.urls),
21 | ]
22 |
--------------------------------------------------------------------------------
/project/install_check_project/install_check_project/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for install_check_project project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'install_check_project.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/project/install_check_project/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'install_check_project.settings')
9 | try:
10 | from django.core.management import execute_from_command_line
11 | except ImportError as exc:
12 | raise ImportError(
13 | "Couldn't import Django. Are you sure it's installed and "
14 | "available on your PYTHONPATH environment variable? Did you "
15 | "forget to activate a virtual environment?"
16 | ) from exc
17 | execute_from_command_line(sys.argv)
18 |
19 |
20 | if __name__ == '__main__':
21 | main()
22 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # 오탈자 안내
2 | - p224. 소스코드 오타 안내
3 | 책의 224페이지의 '코드3-16'에 있는 소스 중, 91번 라인의 '한식' 을 {{ category.category_name}} 으로 변경해주셔야 합니다.
4 |
5 | 책224페이지에 나와있는 소스 중 91번 라인
6 | ```html
7 | 한식
8 | ```
9 | 변경 후 91번 라인
10 | ```html
11 | {{ category.category_name }}
12 | ```
13 |
14 | 불편을 드려 죄송합니다.
15 |
16 |
17 |
18 | # Django 한그릇뚝딱 source code
19 |
20 | chapter2 ~ chapter5 까지의 총 4개 프로젝트에 대한
21 |
22 | 각각의 github 주소는 아래와 같습니다.
23 |
24 | chapter2:
25 |
26 | chapter3:
27 |
28 | chapter4:
29 |
30 | chapter5:
31 |
32 |
33 |
34 | ##### 문의 사항
35 |
36 | 문의 사항은 아래 이메일 또는 오픈 카카오톡 링크를 통해 연락주시면 빠른 시간안에 답변드릴 수 있습니다.
37 |
38 | Email : doorbw@outlook.com
39 |
40 | KaKaoTalk 1:1 채팅 :
41 |
42 | Github : [github.com/doorbw](http://github.com/doorbw)
43 |
44 | 개인블로그:
45 |
46 |
47 |
48 | ##### 안내 사항
49 |
50 | 본 repository을 포함한 에 대한 모든 source code에 대한 권한은 문범우 본인에게 있습니다.
51 |
52 | 무단으로 상업적 및 비상업적으로 배포 및 이용할 경우 적발 시에 민,형사상 처벌을 받을 수 있습니다.
--------------------------------------------------------------------------------