├── .gitignore ├── 04_bookmark ├── bookmark │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── templates │ │ └── bookmark │ │ │ ├── bookmark_confirm_delete.html │ │ │ ├── bookmark_create.html │ │ │ ├── bookmark_detail.html │ │ │ ├── bookmark_list.html │ │ │ └── bookmark_update.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── config │ ├── __init__.py │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── manage.py ├── static │ └── style.css ├── static_files │ ├── admin │ │ ├── css │ │ │ ├── autocomplete.css │ │ │ ├── base.css │ │ │ ├── changelists.css │ │ │ ├── dashboard.css │ │ │ ├── fonts.css │ │ │ ├── forms.css │ │ │ ├── login.css │ │ │ ├── responsive.css │ │ │ ├── responsive_rtl.css │ │ │ ├── rtl.css │ │ │ ├── vendor │ │ │ │ └── select2 │ │ │ │ │ ├── LICENSE-SELECT2.md │ │ │ │ │ ├── select2.css │ │ │ │ │ └── select2.min.css │ │ │ └── widgets.css │ │ ├── fonts │ │ │ ├── LICENSE.txt │ │ │ ├── README.txt │ │ │ ├── Roboto-Bold-webfont.woff │ │ │ ├── Roboto-Light-webfont.woff │ │ │ └── Roboto-Regular-webfont.woff │ │ ├── img │ │ │ ├── LICENSE │ │ │ ├── README.txt │ │ │ ├── calendar-icons.svg │ │ │ ├── gis │ │ │ │ ├── move_vertex_off.svg │ │ │ │ └── move_vertex_on.svg │ │ │ ├── icon-addlink.svg │ │ │ ├── icon-alert.svg │ │ │ ├── icon-calendar.svg │ │ │ ├── icon-changelink.svg │ │ │ ├── icon-clock.svg │ │ │ ├── icon-deletelink.svg │ │ │ ├── icon-no.svg │ │ │ ├── icon-unknown-alt.svg │ │ │ ├── icon-unknown.svg │ │ │ ├── icon-viewlink.svg │ │ │ ├── icon-yes.svg │ │ │ ├── inline-delete.svg │ │ │ ├── search.svg │ │ │ ├── selector-icons.svg │ │ │ ├── sorting-icons.svg │ │ │ ├── tooltag-add.svg │ │ │ └── tooltag-arrowright.svg │ │ └── js │ │ │ ├── SelectBox.js │ │ │ ├── SelectFilter2.js │ │ │ ├── actions.js │ │ │ ├── actions.min.js │ │ │ ├── admin │ │ │ ├── DateTimeShortcuts.js │ │ │ └── RelatedObjectLookups.js │ │ │ ├── autocomplete.js │ │ │ ├── calendar.js │ │ │ ├── cancel.js │ │ │ ├── change_form.js │ │ │ ├── collapse.js │ │ │ ├── collapse.min.js │ │ │ ├── core.js │ │ │ ├── inlines.js │ │ │ ├── inlines.min.js │ │ │ ├── jquery.init.js │ │ │ ├── popup_response.js │ │ │ ├── prepopulate.js │ │ │ ├── prepopulate.min.js │ │ │ ├── prepopulate_init.js │ │ │ ├── urlify.js │ │ │ └── vendor │ │ │ ├── jquery │ │ │ ├── LICENSE.txt │ │ │ ├── jquery.js │ │ │ └── jquery.min.js │ │ │ ├── select2 │ │ │ ├── LICENSE.md │ │ │ ├── i18n │ │ │ │ ├── af.js │ │ │ │ ├── ar.js │ │ │ │ ├── az.js │ │ │ │ ├── bg.js │ │ │ │ ├── bn.js │ │ │ │ ├── bs.js │ │ │ │ ├── ca.js │ │ │ │ ├── cs.js │ │ │ │ ├── da.js │ │ │ │ ├── de.js │ │ │ │ ├── dsb.js │ │ │ │ ├── el.js │ │ │ │ ├── en.js │ │ │ │ ├── es.js │ │ │ │ ├── et.js │ │ │ │ ├── eu.js │ │ │ │ ├── fa.js │ │ │ │ ├── fi.js │ │ │ │ ├── fr.js │ │ │ │ ├── gl.js │ │ │ │ ├── he.js │ │ │ │ ├── hi.js │ │ │ │ ├── hr.js │ │ │ │ ├── hsb.js │ │ │ │ ├── hu.js │ │ │ │ ├── hy.js │ │ │ │ ├── id.js │ │ │ │ ├── is.js │ │ │ │ ├── it.js │ │ │ │ ├── ja.js │ │ │ │ ├── ka.js │ │ │ │ ├── km.js │ │ │ │ ├── ko.js │ │ │ │ ├── lt.js │ │ │ │ ├── lv.js │ │ │ │ ├── mk.js │ │ │ │ ├── ms.js │ │ │ │ ├── nb.js │ │ │ │ ├── ne.js │ │ │ │ ├── nl.js │ │ │ │ ├── pl.js │ │ │ │ ├── ps.js │ │ │ │ ├── pt-BR.js │ │ │ │ ├── pt.js │ │ │ │ ├── ro.js │ │ │ │ ├── ru.js │ │ │ │ ├── sk.js │ │ │ │ ├── sl.js │ │ │ │ ├── sq.js │ │ │ │ ├── sr-Cyrl.js │ │ │ │ ├── sr.js │ │ │ │ ├── sv.js │ │ │ │ ├── th.js │ │ │ │ ├── tk.js │ │ │ │ ├── tr.js │ │ │ │ ├── uk.js │ │ │ │ ├── vi.js │ │ │ │ ├── zh-CN.js │ │ │ │ └── zh-TW.js │ │ │ ├── select2.full.js │ │ │ └── select2.full.min.js │ │ │ └── xregexp │ │ │ ├── LICENSE.txt │ │ │ ├── xregexp.js │ │ │ └── xregexp.min.js │ └── style.css └── templates │ └── base.html ├── 05_dstagram ├── .gitignore ├── Procfile ├── accounts │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── templates │ │ └── registration │ │ │ ├── login.html │ │ │ ├── logout.html │ │ │ ├── register.html │ │ │ └── register_done.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── config │ ├── __init__.py │ ├── asgi.py │ ├── s3media.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── manage.py ├── media │ └── photos │ │ └── 2020 │ │ └── 05 │ │ ├── 16 │ │ ├── image_02_01.png │ │ └── 스크린샷_2016-05-26_오후_5.54.35.png │ │ └── 19 │ │ └── 스크린샷_2016-05-26_오후_5.54.35.png ├── photo │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── templates │ │ └── photo │ │ │ ├── delete.html │ │ │ ├── detail.html │ │ │ ├── list.html │ │ │ ├── update.html │ │ │ └── upload.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── requirements.txt ├── runtime.txt └── templates │ └── base.html ├── 06_onlineshop ├── cart │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── cart.py │ ├── context_processors.py │ ├── forms.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── templates │ │ └── cart │ │ │ └── detail.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── config │ ├── __init__.py │ ├── asgi.py │ ├── s3_media_upload.py │ ├── s3media.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── coupon │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── manage.py ├── order │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── forms.py │ ├── iamport.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── templates │ │ └── order │ │ │ ├── admin │ │ │ ├── detail.html │ │ │ └── pdf.html │ │ │ ├── create.html │ │ │ └── created.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── products │ └── 2020 │ │ └── 06 │ │ └── 26 │ │ └── mbp13touch-space-select-202005_GEO_KR.jpg ├── requirements.txt ├── shop │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── templates │ │ └── shop │ │ │ ├── detail.html │ │ │ └── list.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── static │ ├── css │ │ └── pdf.css │ └── js │ │ └── checkout.js └── templates │ └── base.html ├── 08_booking ├── booking │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── serializers.py │ ├── templates │ │ └── rest_framework_swagger │ │ │ └── base.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── config │ ├── __init__.py │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── manage.py └── django_basic ├── config ├── __init__.py ├── asgi.py ├── settings.py ├── urls.py ├── views.py └── wsgi.py ├── manage.py └── templates └── test.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | venv 3 | __pycache__ 4 | *.pyc 5 | *~ 6 | .idea 7 | *.sqlite3 8 | secret_keys.py 9 | -------------------------------------------------------------------------------- /04_bookmark/bookmark/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baepeu/python_web_programming_django3/b2490d5c0ba320304a42408f9fc0ebc5e6c889b0/04_bookmark/bookmark/__init__.py -------------------------------------------------------------------------------- /04_bookmark/bookmark/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | # 내가 만든 모델을 관리자 페이지에서 관리할 수 있도록 등록 5 | from .models import Bookmark 6 | 7 | admin.site.register(Bookmark) -------------------------------------------------------------------------------- /04_bookmark/bookmark/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BookmarkConfig(AppConfig): 5 | name = 'bookmark' 6 | -------------------------------------------------------------------------------- /04_bookmark/bookmark/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-04-22 15:51 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Bookmark', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('site_name', models.CharField(max_length=100)), 19 | ('url', models.URLField(verbose_name='Site URL')), 20 | ], 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /04_bookmark/bookmark/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baepeu/python_web_programming_django3/b2490d5c0ba320304a42408f9fc0ebc5e6c889b0/04_bookmark/bookmark/migrations/__init__.py -------------------------------------------------------------------------------- /04_bookmark/bookmark/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.urls import reverse 3 | # Create your models here. 4 | # 모델 : 데이터베이스를 SQL없이 다루려고 모델을 사용 5 | # 우리가 데이터를 객체화해서 다루겠다. 6 | # 모델 = 테이블 7 | # 모델의 필드 = 테이블의 컬럼 8 | # 인스턴스 = 테이블의 레코드 9 | # 필드의 값(인스턴스의 필드값) = 레코드의 컬럼 데이터값 10 | class Bookmark(models.Model): 11 | site_name = models.CharField(max_length=100) 12 | url = models.URLField('Site URL') 13 | # 필드의 종류가 결정하는 것 14 | # 1. 데이터베이스의 컬럼 종류 15 | # 2. 제약 사항 (몇글자까지) 16 | # 3. Form의 종류 17 | # 4. Form에서 제약 사항 18 | 19 | def __str__(self): 20 | return "이름 : "+self.site_name+", 주소 : "+self.url 21 | 22 | def get_absolute_url(self): 23 | return reverse('detail', args=[self.id]) 24 | 25 | # 모델을 만들었다 => 데이터베이스에 어떤 데이터들을 어떤 형태로 넣을지 결정! 26 | # makemigrations => 모델의 변경사항을 추적해서 기록 27 | # 마이그레이션(migrate) => 데이터베이스에 모델의 내용을 반영(테이블 생성) 28 | -------------------------------------------------------------------------------- /04_bookmark/bookmark/templates/bookmark/bookmark_confirm_delete.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Confirm Delete{% endblock %} 3 | {% block content %} 4 |
9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /04_bookmark/bookmark/templates/bookmark/bookmark_create.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Bookmark Add{% endblock %} 3 | {% block content %} 4 | 9 | {% endblock %} -------------------------------------------------------------------------------- /04_bookmark/bookmark/templates/bookmark/bookmark_detail.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Detail{% endblock %} 3 | {% block content %} 4 | {{object.site_name}}# | 12 |Site | 13 |URL | 14 |Modify | 15 |Delete | 16 |
---|---|---|---|---|
{{forloop.counter}} | 22 |{{bookmark.site_name}} | 23 |{{bookmark.url}} | 24 |Modify | 25 |Delete | 26 |
Image | 12 |Product | 13 |Quantity | 14 |Remove | 15 |Unit Price | 16 |Price | 17 |
---|---|---|---|---|---|
24 |
25 | |
28 | {{product.name}} | 29 |30 | 36 | | 37 |Remove | 38 |{{item.price}} | 39 |{{item.total_price}} | 40 |
Subtotal | 46 |47 | | {{cart.get_product_total|floatformat:"2"}} | 48 ||||
{{cart.coupon.code}} coupon ({{cart.coupon.amount}}) | 51 |52 | | - {{cart.get_discount_total|floatformat:"2"}} | 53 ||||
Total | 57 |58 | | {{cart.get_total_price|floatformat:"2"}} | 59 |
63 | Add Coupon: 64 |
65 | 70 |71 | Continue shopping 72 | 73 | Checkout 74 |
75 | {% endblock %} -------------------------------------------------------------------------------- /06_onlineshop/cart/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /06_onlineshop/cart/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from .views import * 3 | 4 | app_name = 'cart' 5 | 6 | urlpatterns = [ 7 | path('', detail, name='detail'), 8 | path('add/Created | 24 |{{order.created}} | 25 |
---|---|
Customer | 28 |{{order.first_name}} {{order.last_name}} | 29 |
{{order.email}} | 33 ||
Address | 36 |{{order.address}} {{order.postal_code}} {{order.city}} | 37 |
Total amount | 40 |{{order.get_total_price}} | 41 |
5 | Invoice no. {{order.id}}
6 | {{order.created|date:"M d, Y"}}
7 |
10 | {{order.first_name}} {{order.last_name}}
11 | {{order.email}}
12 | {{order.address}}
13 | {{order.postal_code}}, {{order.city}}
14 |
Product | 20 |Price | 21 |Quantity | 22 |Cost | 23 |
---|---|---|---|
{{item.product.name}} | 29 |{{item.price}} | 30 |{{item.quantity}} | 31 |{{item.get_item_price}} | 32 |
Discount | 37 |{{order.discount}} | 38 |||
Total | 42 |{{order.get_total_price}} | 43 |
Price{{product.price}}
14 | 15 | 20 | 21 |