├── .gitignore ├── ActivitySolutions └── B18654_Activity Solutions.pdf ├── Chapter01 ├── Activity1.01 │ └── bookr │ │ ├── bookr │ │ └── urls.py │ │ └── reviews │ │ ├── templates │ │ └── base.html │ │ ├── tests.py │ │ └── views.py ├── Activity1.02 │ └── bookr │ │ ├── bookr │ │ └── urls.py │ │ └── reviews │ │ ├── templates │ │ └── search-results.html │ │ ├── tests.py │ │ └── views.py ├── Exercise1.01 │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ └── __init__.py │ │ ├── models.py │ │ ├── tests.py │ │ └── views.py ├── Exercise1.03 │ └── bookr │ │ ├── bookr │ │ └── urls.py │ │ └── reviews │ │ ├── tests.py │ │ └── views.py ├── Exercise1.04 │ └── bookr │ │ └── reviews │ │ ├── tests.py │ │ └── views.py ├── Exercise1.05 │ └── bookr │ │ ├── bookr │ │ └── settings.py │ │ └── reviews │ │ ├── templates │ │ └── base.html │ │ └── tests.py ├── Exercise1.06 │ └── bookr │ │ └── reviews │ │ ├── tests.py │ │ └── views.py ├── Exercise1.07 │ └── bookr │ │ └── reviews │ │ ├── templates │ │ └── base.html │ │ ├── tests.py │ │ └── views.py ├── Exercise1.08 │ └── bookr │ │ └── reviews │ │ ├── tests.py │ │ └── views.py ├── final │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ ├── base.html │ │ └── search-results.html │ │ ├── tests.py │ │ └── views.py └── requirements.txt ├── Chapter02 ├── Activity2.01 │ └── juggler │ │ ├── juggler │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── projectm │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20200108_1834.py │ │ ├── 0003_auto_20200108_1858.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── tests.py │ │ └── views.py ├── Exercise2.02 │ └── exercise2.02.py ├── Exercise2.03 │ └── exercise2.03.py ├── Exercise2.04 │ └── exercise2.04.py ├── Exercise2.05 │ └── exercise2.05.py ├── Exercise2.06 │ └── exercise2.06.py ├── Exercise2.07 │ └── exercise2.07.py ├── Exercise2.08 │ └── exercise2.08.py ├── Exercise2.09 │ └── exercise2.09.py ├── Exercise2.10 │ └── exercise2.10.py ├── Exercise2.11 │ └── exercise2.11.py ├── Exercise2.12 │ └── exercise2.12.py ├── Exercise2.13 │ └── exercise2.13.py ├── Exercise2.14 │ └── exercise2.14.py ├── Exercise2.15 │ └── exercise2.15.py ├── Exercise2.16 │ └── exercise2.16.py ├── Exercise2.17 │ └── exercise2.17.py ├── Exercise2.18 │ └── exercise2.18.py ├── final │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ └── loadcsv.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ ├── base.html │ │ └── search-results.html │ │ ├── tests.py │ │ └── views.py └── requirements.txt ├── Chapter03 ├── Activity3.01 │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ └── loadcsv.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ └── reviews │ │ │ ├── base.html │ │ │ ├── book_detail.html │ │ │ ├── book_list.html │ │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py ├── Exercise3.01 │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ └── loadcsv.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ ├── base.html │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py ├── Exercise3.02 │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ └── loadcsv.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ ├── base.html │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py ├── Exercise3.03 │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ └── loadcsv.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ ├── base.html │ │ ├── reviews │ │ │ └── book_list.html │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py ├── Exercise3.04 │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ └── loadcsv.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ └── reviews │ │ │ ├── base.html │ │ │ ├── book_list.html │ │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py ├── final │ └── bookr │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ └── loadcsv.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ └── reviews │ │ │ ├── base.html │ │ │ ├── book_detail.html │ │ │ ├── book_list.html │ │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py └── requirements.txt ├── Chapter04 ├── Activity4.02 │ └── comment8or │ │ ├── admin.py │ │ ├── comment8or │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── templates │ │ │ └── comment8or │ │ │ │ └── logged_out.html │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── messageboard │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── apps.py │ │ ├── migrations │ │ └── __init__.py │ │ ├── models.py │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py ├── Activity4.03 │ └── bookr │ │ └── reviews │ │ ├── admin.py │ │ └── models.py ├── CustomisingTheModelAdminClass │ └── bookr │ │ ├── admin.py │ │ ├── bookr │ │ ├── settings.py │ │ └── urls.py │ │ └── reviews │ │ ├── admin.py │ │ └── apps.py ├── Exercise4.04 │ └── bookr │ │ └── reviews │ │ └── admin.py ├── README.md ├── SearchBarExcludingGrouping │ └── bookr │ │ └── reviews │ │ └── admin.py ├── final │ └── bookr │ │ ├── admin.py │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ └── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── apps.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ └── loadcsv.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ └── reviews │ │ │ ├── base.html │ │ │ ├── book_detail.html │ │ │ ├── book_list.html │ │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py └── requirements.txt ├── Chapter05 ├── Activity5.01 │ └── bookr │ │ ├── admin.py │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ └── loadcsv.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ │ └── templates │ │ └── base.html ├── Activity5.02 │ └── bookr │ │ ├── admin.py │ │ ├── bookr │ │ └── settings.py │ │ ├── manage.py │ │ ├── reviews │ │ └── tests.py │ │ ├── static │ │ └── main.css │ │ └── templates │ │ └── base.html ├── Activity5.03 │ └── bookr │ │ ├── reviews │ │ └── tests.py │ │ ├── static │ │ └── logo.png │ │ └── templates │ │ └── base.html ├── Exercise5.01 │ └── business_site │ │ ├── business_site │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── landing │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── landing │ │ │ │ └── logo.png │ │ ├── tests.py │ │ └── views.py │ │ └── manage.py ├── Exercise5.02 │ └── business_site │ │ ├── business_site │ │ └── urls.py │ │ └── landing │ │ ├── templates │ │ └── index.html │ │ └── tests.py ├── Exercise5.03 │ └── business_site │ │ ├── business_site │ │ └── settings.py │ │ ├── landing │ │ ├── static │ │ │ └── landing │ │ │ │ └── logo.png │ │ ├── templates │ │ │ └── index.html │ │ └── tests.py │ │ ├── manage.py │ │ └── static │ │ └── main.css ├── Exercise5.04 │ └── business_site │ │ ├── business_site │ │ └── settings.py │ │ ├── landing │ │ └── tests.py │ │ └── static_production_test │ │ └── placeholder ├── Exercise5.05 │ └── business_site │ │ ├── business_site │ │ └── settings.py │ │ ├── landing │ │ └── tests.py │ │ ├── static │ │ └── main.css │ │ └── static_production_test │ │ └── placeholder ├── final │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── loadcsv.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ └── search-results.html │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ └── base.html │ └── business_site │ │ ├── business_site │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── landing │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── landing │ │ │ │ └── logo.png │ │ ├── templates │ │ │ └── index.html │ │ ├── tests.py │ │ └── views.py │ │ ├── manage.py │ │ └── static │ │ └── main.css └── requirements.txt ├── Chapter06 ├── Activity6.01 │ └── bookr │ │ ├── admin.py │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── forms.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ └── loadcsv.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ │ ├── static │ │ ├── logo.png │ │ └── main.css │ │ └── templates │ │ └── base.html ├── Exercise6.01 │ └── form_project │ │ ├── form_example │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── form-example.html │ │ ├── tests.py │ │ └── views.py │ │ ├── form_project │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ └── manage.py ├── Exercise6.02 │ └── form_project │ │ └── form_example │ │ ├── templates │ │ └── form-example.html │ │ ├── tests.py │ │ └── views.py ├── Exercise6.03 │ └── form_project │ │ └── form_example │ │ ├── forms.py │ │ ├── templates │ │ └── form-example.html │ │ ├── tests.py │ │ └── views.py ├── Exercise6.04 │ └── form_project │ │ └── form_example │ │ ├── forms.py │ │ ├── tests.py │ │ └── views.py ├── Exercise6.05 │ └── form_project │ │ └── form_example │ │ ├── forms.py │ │ └── tests.py ├── final │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── loadcsv.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ └── search-results.html │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ └── base.html │ └── form_project │ │ ├── form_example │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── form-example.html │ │ ├── tests.py │ │ └── views.py │ │ ├── form_project │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ └── manage.py └── requirements.txt ├── Chapter07 ├── Activity7.01 │ └── bookr │ │ ├── reviews │ │ ├── tests.py │ │ └── views.py │ │ └── templates │ │ └── base.html ├── Activity7.02 │ └── bookr │ │ ├── admin.py │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ ├── reviews │ │ ├── forms.py │ │ ├── templates │ │ │ └── reviews │ │ │ │ ├── book_detail.html │ │ │ │ └── instance-form.html │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ │ ├── static │ │ ├── logo.png │ │ └── main.css │ │ └── templates │ │ └── base.html ├── Exercise7.01 │ └── form_project │ │ ├── form_example │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── form-example.html │ │ ├── tests.py │ │ └── views.py │ │ ├── form_project │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ └── manage.py ├── Exercise7.02 │ └── form_project │ │ └── form_example │ │ ├── forms.py │ │ ├── tests.py │ │ └── views.py ├── Exercise7.03 │ └── bookr │ │ ├── admin.py │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── manage.py │ │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── forms.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ └── loadcsv.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ ├── form-example.html │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ │ ├── static │ │ ├── logo.png │ │ └── main.css │ │ └── templates │ │ └── base.html ├── final │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── loadcsv.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ ├── form-example.html │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ ├── instance-form.html │ │ │ │ │ └── search-results.html │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ └── base.html │ └── form_project │ │ ├── form_example │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── form-example.html │ │ ├── tests.py │ │ └── views.py │ │ ├── form_project │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ └── manage.py └── requirements.txt ├── Chapter08 ├── Activity8.01 │ └── bookr │ │ ├── admin.py │ │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── fixtures │ │ ├── machine-learning-for-algorithmic-trading.png │ │ └── machine-learning-for-trading.pdf │ │ ├── manage.py │ │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── forms.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ └── loadcsv.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ ├── instance-form.html │ │ │ │ └── search-results.html │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ │ ├── static │ │ ├── logo.png │ │ └── main.css │ │ └── templates │ │ └── base.html ├── Activity8.02 │ └── bookr │ │ └── reviews │ │ ├── templates │ │ └── reviews │ │ │ └── book_detail.html │ │ └── tests.py ├── Exercise8.01 │ └── media_project │ │ ├── manage.py │ │ ├── media │ │ └── test.txt │ │ ├── media_example │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── tests.py │ │ └── views.py │ │ └── media_project │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py ├── Exercise8.02 │ └── media_project │ │ ├── media_example │ │ ├── templates │ │ │ └── media-example.html │ │ ├── tests.py │ │ └── views.py │ │ └── media_project │ │ ├── settings.py │ │ └── urls.py ├── Exercise8.03 │ └── media_project │ │ ├── fixtures │ │ ├── cover.jpg │ │ └── sample.txt │ │ ├── media │ │ └── cover.jpg │ │ └── media_example │ │ ├── templates │ │ └── media-example.html │ │ ├── tests.py │ │ └── views.py ├── Exercise8.04 │ └── media_project │ │ └── media_example │ │ ├── forms.py │ │ ├── templates │ │ └── media-example.html │ │ ├── tests.py │ │ └── views.py ├── Exercise8.05 │ └── media_project │ │ ├── media │ │ └── cover.jpg │ │ └── media_example │ │ ├── forms.py │ │ ├── tests.py │ │ └── views.py ├── Exercise8.06 │ └── media_project │ │ ├── media │ │ ├── files │ │ │ └── placeholder │ │ └── images │ │ │ └── placeholder │ │ └── media_example │ │ ├── forms.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ └── media-example.html │ │ ├── tests.py │ │ └── views.py ├── Exercise8.07 │ └── media_project │ │ ├── media │ │ ├── cover.jpg │ │ ├── files │ │ │ └── placeholder │ │ ├── images │ │ │ ├── cover_8GmKBdR.jpg │ │ │ ├── cover_uf1yjUz.jpg │ │ │ └── placeholder │ │ └── test.txt │ │ └── media_example │ │ ├── forms.py │ │ ├── tests.py │ │ └── views.py ├── final │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── fixtures │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ └── machine-learning-for-trading.pdf │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── loadcsv.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ ├── instance-form.html │ │ │ │ │ └── search-results.html │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ └── base.html │ └── media_project │ │ ├── fixtures │ │ ├── cover.jpg │ │ └── sample.txt │ │ ├── manage.py │ │ ├── media │ │ ├── cover.jpg │ │ ├── files │ │ │ ├── sample_oMGMUVy.txt │ │ │ └── sample_vLDxpxz.txt │ │ ├── images │ │ │ ├── cover_8GmKBdR.jpg │ │ │ └── cover_uf1yjUz.jpg │ │ └── test.txt │ │ ├── media_example │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── media-example.html │ │ ├── tests.py │ │ └── views.py │ │ └── media_project │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py └── requirements.txt ├── Chapter09 ├── Activity9.01 │ └── bookr │ │ ├── reviews │ │ └── templates │ │ │ └── reviews │ │ │ └── book_detail.html │ │ └── templates │ │ └── base.html ├── Activity9.02 │ └── bookr │ │ ├── reviews │ │ └── views.py │ │ └── templates │ │ └── profile.html ├── Exercise9.01 │ └── bookr │ │ ├── bookr │ │ └── urls.py │ │ └── templates │ │ ├── base.html │ │ └── registration │ │ ├── logged_out.html │ │ ├── login.html │ │ ├── password_change_done.html │ │ ├── password_change_form.html │ │ ├── password_reset_complete.html │ │ ├── password_reset_confirm.html │ │ ├── password_reset_done.html │ │ ├── password_reset_email.html │ │ └── password_reset_form.html ├── Exercise9.02 │ └── bookr │ │ ├── bookr │ │ ├── urls.py │ │ └── views.py │ │ └── templates │ │ └── profile.html ├── Exercise9.03 │ └── bookr │ │ ├── bookr │ │ └── views.py │ │ └── reviews │ │ └── views.py ├── Exercise9.04 │ └── bookr │ │ └── templates │ │ └── base.html ├── Exercise9.05 │ └── bookr │ │ └── reviews │ │ └── management │ │ └── commands │ │ └── sessioninfo.py ├── Exercise9.06 │ └── bookr │ │ ├── reviews │ │ └── views.py │ │ └── templates │ │ └── profile.html └── final │ └── bookr │ ├── admin.py │ ├── bookr │ ├── __init__.py │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ ├── views.py │ └── wsgi.py │ ├── fixtures │ ├── machine-learning-for-algorithmic-trading.png │ └── machine-learning-for-trading.pdf │ ├── manage.py │ ├── reviews │ ├── __init__.py │ ├── admin.py │ ├── adminconfig.py │ ├── apps.py │ ├── appsadmin.py │ ├── forms.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ ├── loadcsv.py │ │ │ └── sessioninfo.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_book_cover_book_sample.py │ │ └── __init__.py │ ├── models.py │ ├── static │ │ └── reviews │ │ │ └── logo.png │ ├── templates │ │ └── reviews │ │ │ ├── base.html │ │ │ ├── book_detail.html │ │ │ ├── book_list.html │ │ │ ├── instance-form.html │ │ │ └── search-results.html │ ├── tests.py │ ├── urls.py │ ├── utils.py │ └── views.py │ ├── static │ ├── logo.png │ └── main.css │ └── templates │ ├── base.html │ ├── profile.html │ └── registration │ ├── logged_out.html │ ├── login.html │ ├── password_change_done.html │ ├── password_change_form.html │ ├── password_reset_complete.html │ ├── password_reset_confirm.html │ ├── password_reset_done.html │ ├── password_reset_email.html │ └── password_reset_form.html ├── Chapter10 ├── Activity10.01 │ ├── bookr │ │ ├── settings.py │ │ └── urls.py │ ├── bookr_admin │ │ ├── admin.py │ │ └── apps.py │ └── reviews │ │ └── admin.py ├── Exercise10.01 │ ├── bookr │ │ └── urls.py │ └── bookr_admin │ │ └── admin.py ├── Exercise10.02 │ ├── bookr │ │ ├── settings.py │ │ └── urls.py │ └── bookr_admin │ │ ├── admin.py │ │ └── apps.py ├── Exercise10.03 │ ├── bookr_admin │ │ └── admin.py │ └── templates │ │ └── admin │ │ └── logout.html ├── Exercise10.04 │ ├── bookr_admin │ │ └── admin.py │ └── templates │ │ └── admin │ │ └── admin_profile.html └── final │ └── bookr │ ├── admin.py │ ├── bookr │ ├── __init__.py │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ ├── views.py │ └── wsgi.py │ ├── bookr_admin │ ├── admin.py │ └── apps.py │ ├── fixtures │ ├── machine-learning-for-algorithmic-trading.png │ └── machine-learning-for-trading.pdf │ ├── manage.py │ ├── reviews │ ├── __init__.py │ ├── admin.py │ ├── adminconfig.py │ ├── apps.py │ ├── appsadmin.py │ ├── forms.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ ├── loadcsv.py │ │ │ └── sessioninfo.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_book_cover_book_sample.py │ │ └── __init__.py │ ├── models.py │ ├── static │ │ └── reviews │ │ │ └── logo.png │ ├── templates │ │ └── reviews │ │ │ ├── base.html │ │ │ ├── book_detail.html │ │ │ ├── book_list.html │ │ │ ├── instance-form.html │ │ │ └── search-results.html │ ├── tests.py │ ├── urls.py │ ├── utils.py │ └── views.py │ ├── static │ ├── logo.png │ └── main.css │ └── templates │ ├── base.html │ ├── profile.html │ └── registration │ ├── logged_out.html │ ├── login.html │ ├── password_change_done.html │ ├── password_change_form.html │ ├── password_reset_complete.html │ ├── password_reset_confirm.html │ ├── password_reset_done.html │ ├── password_reset_email.html │ └── password_reset_form.html ├── Chapter11 ├── Activit11.01 │ ├── reviews │ │ ├── templates │ │ │ └── book_list.html │ │ └── templatetags │ │ │ └── profile_tags.py │ └── templates │ │ └── profile.html ├── Exercise11.01 │ ├── bookr │ │ ├── settings.py │ │ └── urls.py │ └── filter_demo │ │ ├── templates │ │ └── index.html │ │ ├── templatetags │ │ └── explode_filter.py │ │ ├── urls.py │ │ └── views.py ├── Exercise11.02 │ └── filter_demo │ │ ├── templates │ │ └── simple_tag_template.html │ │ ├── templatetags │ │ └── simple_tag.py │ │ ├── urls.py │ │ └── views.py ├── Exercise11.03 │ └── filter_demo │ │ ├── templates │ │ ├── book_list.html │ │ └── simple_tag_template.html │ │ ├── templatetags │ │ ├── inclusion_tag.py │ │ └── simple_tag.py │ │ └── views.py ├── Exercise11.04 │ ├── book_management │ │ ├── forms.py │ │ ├── models.py │ │ ├── templates │ │ │ └── book_form.html │ │ ├── urls.py │ │ └── views.py │ └── bookr │ │ ├── settings.py │ │ └── urls.py └── final │ └── bookr │ ├── admin.py │ ├── bookr │ ├── __init__.py │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ ├── views.py │ └── wsgi.py │ ├── bookr_admin │ ├── admin.py │ └── apps.py │ ├── fixtures │ ├── machine-learning-for-algorithmic-trading.png │ └── machine-learning-for-trading.pdf │ ├── manage.py │ ├── reviews │ ├── __init__.py │ ├── admin.py │ ├── adminconfig.py │ ├── apps.py │ ├── appsadmin.py │ ├── forms.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── WebDevWithDjangoData.csv │ │ │ ├── __init__.py │ │ │ ├── loadcsv.py │ │ │ └── sessioninfo.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_book_cover_book_sample.py │ │ └── __init__.py │ ├── models.py │ ├── static │ │ └── reviews │ │ │ └── logo.png │ ├── templates │ │ ├── book_list.html │ │ └── reviews │ │ │ ├── base.html │ │ │ ├── book_detail.html │ │ │ ├── book_list.html │ │ │ ├── instance-form.html │ │ │ └── search-results.html │ ├── templatetags │ │ └── profile_tags.py │ ├── tests.py │ ├── urls.py │ ├── utils.py │ └── views.py │ ├── static │ ├── logo.png │ └── main.css │ └── templates │ ├── base.html │ ├── profile.html │ └── registration │ ├── logged_out.html │ ├── login.html │ ├── password_change_done.html │ ├── password_change_form.html │ ├── password_reset_complete.html │ ├── password_reset_confirm.html │ ├── password_reset_done.html │ ├── password_reset_email.html │ └── password_reset_form.html ├── Chapter12 ├── Activity12.01 │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── wsgi.py │ │ ├── bookr_admin │ │ │ ├── admin.py │ │ │ └── apps.py │ │ ├── fixtures │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ └── machine-learning-for-trading.pdf │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── api_views.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── loadcsv.py │ │ │ │ │ └── sessioninfo.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ ├── book_list.html │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ ├── instance-form.html │ │ │ │ │ └── search-results.html │ │ │ ├── templatetags │ │ │ │ └── profile_tags.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ ├── base.html │ │ │ ├── profile.html │ │ │ └── registration │ │ │ ├── logged_out.html │ │ │ ├── login.html │ │ │ ├── password_change_done.html │ │ │ ├── password_change_form.html │ │ │ ├── password_reset_complete.html │ │ │ ├── password_reset_confirm.html │ │ │ ├── password_reset_done.html │ │ │ ├── password_reset_email.html │ │ │ └── password_reset_form.html │ └── requirements.txt ├── Exercise12.01 │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── wsgi.py │ │ ├── bookr_admin │ │ │ ├── admin.py │ │ │ └── apps.py │ │ ├── fixtures │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ └── machine-learning-for-trading.pdf │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── api_views.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── loadcsv.py │ │ │ │ │ └── sessioninfo.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ ├── book_list.html │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ ├── instance-form.html │ │ │ │ │ └── search-results.html │ │ │ ├── templatetags │ │ │ │ └── profile_tags.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ ├── base.html │ │ │ ├── profile.html │ │ │ └── registration │ │ │ ├── logged_out.html │ │ │ ├── login.html │ │ │ ├── password_change_done.html │ │ │ ├── password_change_form.html │ │ │ ├── password_reset_complete.html │ │ │ ├── password_reset_confirm.html │ │ │ ├── password_reset_done.html │ │ │ ├── password_reset_email.html │ │ │ └── password_reset_form.html │ └── requirements.txt ├── Exercise12.02 │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── wsgi.py │ │ ├── bookr_admin │ │ │ ├── admin.py │ │ │ └── apps.py │ │ ├── fixtures │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ └── machine-learning-for-trading.pdf │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── api_views.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── loadcsv.py │ │ │ │ │ └── sessioninfo.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ ├── book_list.html │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ ├── instance-form.html │ │ │ │ │ └── search-results.html │ │ │ ├── templatetags │ │ │ │ └── profile_tags.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ ├── base.html │ │ │ ├── profile.html │ │ │ └── registration │ │ │ ├── logged_out.html │ │ │ ├── login.html │ │ │ ├── password_change_done.html │ │ │ ├── password_change_form.html │ │ │ ├── password_reset_complete.html │ │ │ ├── password_reset_confirm.html │ │ │ ├── password_reset_done.html │ │ │ ├── password_reset_email.html │ │ │ └── password_reset_form.html │ └── requirements.txt ├── Exercise12.03 │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── wsgi.py │ │ ├── bookr_admin │ │ │ ├── admin.py │ │ │ └── apps.py │ │ ├── fixtures │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ └── machine-learning-for-trading.pdf │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── api_views.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── loadcsv.py │ │ │ │ │ └── sessioninfo.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ ├── book_list.html │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ ├── instance-form.html │ │ │ │ │ └── search-results.html │ │ │ ├── templatetags │ │ │ │ └── profile_tags.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ ├── base.html │ │ │ ├── profile.html │ │ │ └── registration │ │ │ ├── logged_out.html │ │ │ ├── login.html │ │ │ ├── password_change_done.html │ │ │ ├── password_change_form.html │ │ │ ├── password_reset_complete.html │ │ │ ├── password_reset_confirm.html │ │ │ ├── password_reset_done.html │ │ │ ├── password_reset_email.html │ │ │ └── password_reset_form.html │ └── requirements.txt ├── Exercise12.04 │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── wsgi.py │ │ ├── bookr_admin │ │ │ ├── admin.py │ │ │ └── apps.py │ │ ├── fixtures │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ └── machine-learning-for-trading.pdf │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── api_views.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── loadcsv.py │ │ │ │ │ └── sessioninfo.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ ├── book_list.html │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ ├── instance-form.html │ │ │ │ │ └── search-results.html │ │ │ ├── templatetags │ │ │ │ └── profile_tags.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ ├── base.html │ │ │ ├── profile.html │ │ │ └── registration │ │ │ ├── logged_out.html │ │ │ ├── login.html │ │ │ ├── password_change_done.html │ │ │ ├── password_change_form.html │ │ │ ├── password_reset_complete.html │ │ │ ├── password_reset_confirm.html │ │ │ ├── password_reset_done.html │ │ │ ├── password_reset_email.html │ │ │ └── password_reset_form.html │ └── requirements.txt ├── Exercise12.05 │ ├── bookr │ │ ├── admin.py │ │ ├── bookr │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── wsgi.py │ │ ├── bookr_admin │ │ │ ├── admin.py │ │ │ └── apps.py │ │ ├── fixtures │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ └── machine-learning-for-trading.pdf │ │ ├── manage.py │ │ ├── reviews │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── adminconfig.py │ │ │ ├── api_views.py │ │ │ ├── apps.py │ │ │ ├── appsadmin.py │ │ │ ├── forms.py │ │ │ ├── management │ │ │ │ ├── __init__.py │ │ │ │ └── commands │ │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── loadcsv.py │ │ │ │ │ └── sessioninfo.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── static │ │ │ │ └── reviews │ │ │ │ │ └── logo.png │ │ │ ├── templates │ │ │ │ ├── book_list.html │ │ │ │ └── reviews │ │ │ │ │ ├── base.html │ │ │ │ │ ├── book_detail.html │ │ │ │ │ ├── book_list.html │ │ │ │ │ ├── instance-form.html │ │ │ │ │ └── search-results.html │ │ │ ├── templatetags │ │ │ │ └── profile_tags.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── logo.png │ │ │ └── main.css │ │ └── templates │ │ │ ├── base.html │ │ │ ├── profile.html │ │ │ └── registration │ │ │ ├── logged_out.html │ │ │ ├── login.html │ │ │ ├── password_change_done.html │ │ │ ├── password_change_form.html │ │ │ ├── password_reset_complete.html │ │ │ ├── password_reset_confirm.html │ │ │ ├── password_reset_done.html │ │ │ ├── password_reset_email.html │ │ │ └── password_reset_form.html │ └── requirements.txt └── final │ ├── bookr │ ├── admin.py │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ ├── views.py │ │ └── wsgi.py │ ├── bookr_admin │ │ ├── admin.py │ │ └── apps.py │ ├── fixtures │ │ ├── machine-learning-for-algorithmic-trading.png │ │ └── machine-learning-for-trading.pdf │ ├── manage.py │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── api_views.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── forms.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ ├── loadcsv.py │ │ │ │ └── sessioninfo.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── serializers.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ ├── book_list.html │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ ├── instance-form.html │ │ │ │ └── search-results.html │ │ ├── templatetags │ │ │ └── profile_tags.py │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ ├── static │ │ ├── logo.png │ │ └── main.css │ └── templates │ │ ├── base.html │ │ ├── profile.html │ │ └── registration │ │ ├── logged_out.html │ │ ├── login.html │ │ ├── password_change_done.html │ │ ├── password_change_form.html │ │ ├── password_reset_complete.html │ │ ├── password_reset_confirm.html │ │ ├── password_reset_done.html │ │ ├── password_reset_email.html │ │ └── password_reset_form.html │ └── requirements.txt ├── Chapter13 ├── Activity13.01 │ ├── bookr │ │ ├── bookr │ │ │ ├── urls.py │ │ │ ├── utils.py │ │ │ └── views.py │ │ └── manage.py │ └── requirements.txt ├── Exercise13.01 │ ├── csv_reader.py │ └── market_cap.csv ├── Exercise13.02 │ ├── csv_writer.py │ └── sample_output.csv ├── Exercise13.03 │ ├── requirements.txt │ ├── sample_workbook.xlsx │ └── xlsx_demo.py ├── Exercise13.04 │ ├── demo_page.pdf │ ├── pdf_demo.py │ └── requirements.txt ├── Exercise13.05 │ ├── plot_demo.html │ ├── requirements.txt │ └── scatter_plot_demo.py ├── Exercise13.06 │ ├── bookr │ │ ├── bookr │ │ │ ├── utils.py │ │ │ └── views.py │ │ ├── manage.py │ │ └── templates │ │ │ └── profile.html │ └── requirements.txt └── final │ ├── bookr │ ├── admin.py │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ ├── utils.py │ │ ├── views.py │ │ └── wsgi.py │ ├── bookr_admin │ │ ├── admin.py │ │ └── apps.py │ ├── fixtures │ │ ├── machine-learning-for-algorithmic-trading.png │ │ └── machine-learning-for-trading.pdf │ ├── manage.py │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── api_views.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── forms.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ ├── loadcsv.py │ │ │ │ └── sessioninfo.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── serializers.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ ├── book_list.html │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ ├── instance-form.html │ │ │ │ └── search-results.html │ │ ├── templatetags │ │ │ └── profile_tags.py │ │ ├── tests.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ ├── static │ │ ├── logo.png │ │ └── main.css │ └── templates │ │ ├── base.html │ │ ├── profile.html │ │ └── registration │ │ ├── logged_out.html │ │ ├── login.html │ │ ├── password_change_done.html │ │ ├── password_change_form.html │ │ ├── password_reset_complete.html │ │ ├── password_reset_confirm.html │ │ ├── password_reset_done.html │ │ ├── password_reset_email.html │ │ └── password_reset_form.html │ └── requirements.txt ├── Chapter14 ├── Activity14.01 │ ├── manage.py │ └── reviews │ │ └── tests │ │ ├── __init__.py │ │ ├── test_models.py │ │ └── test_views.py ├── Exercise14.01 │ ├── manage.py │ └── reviews │ │ └── tests.py ├── Exercise14.02 │ ├── bookr │ │ └── settings.py │ ├── bookr_test │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── tests.py │ │ └── views.py │ └── manage.py ├── Exercise14.03 │ ├── bookr │ │ └── urls.py │ ├── bookr_test │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ └── manage.py ├── Exercise14.04 │ ├── bookr_test │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ └── manage.py ├── Exercise14.05 │ ├── bookr_test │ │ └── tests.py │ └── manage.py └── final │ ├── bookr │ ├── admin.py │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ ├── utils.py │ │ ├── views.py │ │ └── wsgi.py │ ├── bookr_admin │ │ ├── admin.py │ │ └── apps.py │ ├── fixtures │ │ ├── machine-learning-for-algorithmic-trading.png │ │ └── machine-learning-for-trading.pdf │ ├── manage.py │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── api_views.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── forms.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ ├── loadcsv.py │ │ │ │ └── sessioninfo.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── serializers.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ ├── book_list.html │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ ├── instance-form.html │ │ │ │ └── search-results.html │ │ ├── templatetags │ │ │ └── profile_tags.py │ │ ├── tests.py │ │ ├── tests │ │ │ ├── __init__.py │ │ │ ├── test_models.py │ │ │ └── test_views.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ ├── static │ │ ├── logo.png │ │ └── main.css │ └── templates │ │ ├── base.html │ │ ├── profile.html │ │ └── registration │ │ ├── logged_out.html │ │ ├── login.html │ │ ├── password_change_done.html │ │ ├── password_change_form.html │ │ ├── password_reset_complete.html │ │ ├── password_reset_confirm.html │ │ ├── password_reset_done.html │ │ ├── password_reset_email.html │ │ └── password_reset_form.html │ └── requirements.txt ├── Chapter15 ├── Activity15.01 │ └── bookr │ │ └── bookr │ │ └── settings.py ├── Exercise15.01 │ └── bookr │ │ ├── bookr │ │ └── settings.py │ │ └── manage.py ├── Exercise15.02 │ └── bookr │ │ └── bookr │ │ └── settings.py ├── Exercise15.03 │ └── bookr │ │ └── bookr │ │ ├── settings.py │ │ └── urls.py ├── Exercise15.04 │ └── bookr │ │ ├── bookr │ │ └── settings.py │ │ └── reviews │ │ ├── forms.py │ │ └── templates │ │ └── reviews │ │ ├── instance-form.html │ │ └── search-results.html └── final │ ├── bookr │ ├── admin.py │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ ├── utils.py │ │ ├── views.py │ │ └── wsgi.py │ ├── bookr_admin │ │ ├── admin.py │ │ └── apps.py │ ├── fixtures │ │ ├── machine-learning-for-algorithmic-trading.png │ │ └── machine-learning-for-trading.pdf │ ├── manage.py │ ├── media │ │ ├── book_covers │ │ │ ├── logo.png │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ ├── machine-learning-for-algorithmic-trading_6NSmBRk.png │ │ │ ├── machine-learning-for-algorithmic-trading_PAm2uE3.png │ │ │ ├── machine-learning-for-algorithmic-trading_d0AAhse.png │ │ │ └── machine-learning-for-algorithmic-trading_sSOhJiQ.png │ │ └── book_samples │ │ │ ├── machine-learning-for-trading.pdf │ │ │ ├── machine-learning-for-trading_572jJkh.pdf │ │ │ ├── machine-learning-for-trading_USBblY5.pdf │ │ │ ├── machine-learning-for-trading_Wk6Qiab.pdf │ │ │ └── main.css │ ├── requirements.txt │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── api_views.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── forms.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ ├── loadcsv.py │ │ │ │ └── sessioninfo.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── serializers.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ ├── book_list.html │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ ├── instance-form.html │ │ │ │ └── search-results.html │ │ ├── templatetags │ │ │ └── profile_tags.py │ │ ├── tests.py │ │ ├── tests │ │ │ ├── __init__.py │ │ │ ├── test_models.py │ │ │ └── test_views.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ ├── static │ │ ├── logo.png │ │ └── main.css │ └── templates │ │ ├── base.html │ │ ├── profile.html │ │ └── registration │ │ ├── logged_out.html │ │ ├── login.html │ │ ├── password_change_done.html │ │ ├── password_change_form.html │ │ ├── password_reset_complete.html │ │ ├── password_reset_confirm.html │ │ ├── password_reset_done.html │ │ ├── password_reset_email.html │ │ └── password_reset_form.html │ └── requirements.txt ├── Chapter16 ├── Activity1601 │ └── bookr │ │ ├── bookr │ │ └── urls.py │ │ ├── reviews │ │ └── tests.py │ │ ├── static │ │ └── recent-reviews.js │ │ └── templates │ │ └── base.html ├── Exercise1601 │ └── bookr │ │ ├── bookr │ │ └── urls.py │ │ ├── reviews │ │ └── views.py │ │ ├── static │ │ └── templates │ │ └── react-example.html ├── Exercise1602 │ └── bookr │ │ ├── static │ │ └── react-example.js │ │ └── templates │ │ └── react-example.html ├── Exercise1603 │ └── bookr │ │ ├── reviews │ │ └── views.py │ │ ├── static │ │ └── react-example.js │ │ └── templates │ │ └── react-example.html ├── Exercise1604 │ └── bookr │ │ ├── static │ │ └── react-example.js │ │ └── templates │ │ └── react-example.html └── final │ ├── bookr │ ├── admin.py │ ├── bookr │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ ├── utils.py │ │ ├── views.py │ │ └── wsgi.py │ ├── bookr_admin │ │ ├── admin.py │ │ └── apps.py │ ├── fixtures │ │ ├── machine-learning-for-algorithmic-trading.png │ │ └── machine-learning-for-trading.pdf │ ├── manage.py │ ├── media │ │ ├── book_covers │ │ │ ├── logo.png │ │ │ ├── machine-learning-for-algorithmic-trading.png │ │ │ ├── machine-learning-for-algorithmic-trading_6NSmBRk.png │ │ │ ├── machine-learning-for-algorithmic-trading_PAm2uE3.png │ │ │ ├── machine-learning-for-algorithmic-trading_d0AAhse.png │ │ │ └── machine-learning-for-algorithmic-trading_sSOhJiQ.png │ │ └── book_samples │ │ │ ├── machine-learning-for-trading.pdf │ │ │ ├── machine-learning-for-trading_572jJkh.pdf │ │ │ ├── machine-learning-for-trading_USBblY5.pdf │ │ │ ├── machine-learning-for-trading_Wk6Qiab.pdf │ │ │ └── main.css │ ├── requirements.txt │ ├── reviews │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── adminconfig.py │ │ ├── api_views.py │ │ ├── apps.py │ │ ├── appsadmin.py │ │ ├── forms.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── WebDevWithDjangoData.csv │ │ │ │ ├── __init__.py │ │ │ │ ├── loadcsv.py │ │ │ │ └── sessioninfo.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_book_cover_book_sample.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── serializers.py │ │ ├── static │ │ │ └── reviews │ │ │ │ └── logo.png │ │ ├── templates │ │ │ ├── book_list.html │ │ │ └── reviews │ │ │ │ ├── base.html │ │ │ │ ├── book_detail.html │ │ │ │ ├── book_list.html │ │ │ │ ├── instance-form.html │ │ │ │ └── search-results.html │ │ ├── templatetags │ │ │ └── profile_tags.py │ │ ├── tests.py │ │ ├── tests │ │ │ ├── __init__.py │ │ │ ├── test_models.py │ │ │ └── test_views.py │ │ ├── urls.py │ │ ├── utils.py │ │ └── views.py │ ├── static │ │ ├── logo.png │ │ ├── main.css │ │ └── recent-reviews.js │ └── templates │ │ ├── base.html │ │ ├── profile.html │ │ └── registration │ │ ├── logged_out.html │ │ ├── login.html │ │ ├── password_change_done.html │ │ ├── password_change_form.html │ │ ├── password_reset_complete.html │ │ ├── password_reset_confirm.html │ │ ├── password_reset_done.html │ │ ├── password_reset_email.html │ │ └── password_reset_form.html │ └── requirements.txt ├── LICENSE ├── Online Chapters ├── B18654_17.pdf └── B18654_18.pdf └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pyc 3 | .idea 4 | *.sqlite3 5 | -------------------------------------------------------------------------------- /ActivitySolutions/B18654_Activity Solutions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/ActivitySolutions/B18654_Activity Solutions.pdf -------------------------------------------------------------------------------- /Chapter01/Activity1.01/bookr/reviews/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome to Bookr 6 | 7 | 8 |

Welcome to Bookr

9 | 10 | -------------------------------------------------------------------------------- /Chapter01/Activity1.01/bookr/reviews/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def index(request): 5 | return render(request, "base.html") 6 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.01/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter01/Exercise1.01/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter01/Exercise1.01/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter01/Exercise1.01/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter01/Exercise1.01/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.01/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.01/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter01/Exercise1.01/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter01/Exercise1.01/bookr/reviews/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.01/bookr/reviews/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.03/bookr/reviews/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse 2 | 3 | 4 | def index(request): 5 | return HttpResponse("Hello, world!") 6 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.04/bookr/reviews/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse 2 | 3 | 4 | def index(request): 5 | name = request.GET.get("name") or "world" 6 | return HttpResponse("Hello, {}!".format(name)) 7 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.05/bookr/reviews/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | Hello from a template! 9 | 10 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.06/bookr/reviews/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def index(request): 5 | return render(request, "base.html") 6 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.07/bookr/reviews/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | Hello, {{ name }}! 9 | 10 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.07/bookr/reviews/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def index(request): 5 | name = "world" 6 | return render(request, "base.html", {"name": name}) 7 | -------------------------------------------------------------------------------- /Chapter01/Exercise1.08/bookr/reviews/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def index(request): 5 | name = "world" 6 | return render(request, "base.html", {"name": invalid_name}) 7 | -------------------------------------------------------------------------------- /Chapter01/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter01/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter01/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter01/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter01/final/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter01/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter01/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter01/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter01/final/bookr/reviews/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter01/final/bookr/reviews/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome to Bookr 6 | 7 | 8 |

Welcome to Bookr

9 | 10 | -------------------------------------------------------------------------------- /Chapter01/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | sqlparse==0.4.2 4 | -------------------------------------------------------------------------------- /Chapter02/Activity2.01/juggler/juggler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter02/Activity2.01/juggler/juggler/__init__.py -------------------------------------------------------------------------------- /Chapter02/Activity2.01/juggler/projectm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter02/Activity2.01/juggler/projectm/__init__.py -------------------------------------------------------------------------------- /Chapter02/Activity2.01/juggler/projectm/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter02/Activity2.01/juggler/projectm/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ProjectmConfig(AppConfig): 5 | name = 'projectm' 6 | -------------------------------------------------------------------------------- /Chapter02/Activity2.01/juggler/projectm/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter02/Activity2.01/juggler/projectm/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter02/Activity2.01/juggler/projectm/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Chapter02/Activity2.01/juggler/projectm/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Chapter02/Exercise2.03/exercise2.03.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from reviews.models import Contributor 4 | 5 | contributor = Contributor.objects.create(first_names='Rowel', last_names='Atienza', email='RowelAtienza@example.com') 6 | -------------------------------------------------------------------------------- /Chapter02/Exercise2.07/exercise2.07.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from reviews.models import Publisher 4 | 5 | publisher = Publisher.objects.get(name='Pocket Books') 6 | -------------------------------------------------------------------------------- /Chapter02/Exercise2.08/exercise2.08.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from reviews.models import Contributor 4 | 5 | contributors = Contributor.objects.all() 6 | -------------------------------------------------------------------------------- /Chapter02/Exercise2.10/exercise2.10.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from reviews.models import Contributor 4 | 5 | Contributor.objects.filter(book__title='The Talisman') 6 | -------------------------------------------------------------------------------- /Chapter02/Exercise2.11/exercise2.11.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from reviews.models import Book 4 | 5 | book = Book.objects.get(title='The Talisman') 6 | 7 | book.contributors.all() -------------------------------------------------------------------------------- /Chapter02/Exercise2.12/exercise2.12.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from reviews.models import Contributor 4 | 5 | contributor = Contributor.objects.get(first_names='Rowel') 6 | 7 | contributor.book_set.all() 8 | -------------------------------------------------------------------------------- /Chapter02/Exercise2.13/exercise2.13.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from reviews.models import Contributor 4 | 5 | 6 | Contributor.objects.filter(last_names='Tyrrell').update(first_names='Mike') 7 | 8 | 9 | Contributor.objects.get(last_names='Tyrrell').first_names -------------------------------------------------------------------------------- /Chapter02/Exercise2.14/exercise2.14.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from reviews.models import Contributor 4 | 5 | Contributor.objects.get(last_names='Wharton').delete() 6 | 7 | Contributor.objects.get(last_names='Wharton') 8 | -------------------------------------------------------------------------------- /Chapter02/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter02/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter02/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter02/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter02/final/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter02/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter02/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter02/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter02/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter02/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter02/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter02/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter02/final/bookr/reviews/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome to Bookr 6 | 7 | 8 |

Welcome to Bookr

9 | 10 | -------------------------------------------------------------------------------- /Chapter02/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | sqlparse==0.4.2 4 | -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Activity3.01/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Activity3.01/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Activity3.01/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Activity3.01/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Activity3.01/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('books/', views.book_list, name='book_list'), 6 | path('books//', views.book_detail, name='book_detail') 7 | ] 8 | -------------------------------------------------------------------------------- /Chapter03/Activity3.01/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.01/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.01/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.01/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.01/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.01/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/reviews/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome to Bookr 6 | 7 | 8 |

Welcome to Bookr

9 | 10 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.01/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('', views.welcome_view, name='welcome'), 6 | ] 7 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.02/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.02/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.02/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.02/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.02/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/reviews/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Home Page 6 | 7 | 8 |

Welcome to Bookr!

9 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.02/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('', views.welcome_view, name='welcome'), 6 | ] 7 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.03/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.03/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.03/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.03/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.03/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Home Page 6 | 7 | 8 |

Welcome to Bookr!

9 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('books/', views.book_list, name='book_list') 6 | ] 7 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.03/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.04/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.04/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.04/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.04/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/Exercise3.04/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('books/', views.book_list, name='book_list') 6 | ] 7 | -------------------------------------------------------------------------------- /Chapter03/Exercise3.04/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) -------------------------------------------------------------------------------- /Chapter03/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter03/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter03/final/bookr/reviews/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter03/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter03/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter03/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter03/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter03/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter03/final/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('books/', views.book_list, name='book_list'), 6 | path('books//', views.book_detail, name='book_detail') 7 | ] 8 | -------------------------------------------------------------------------------- /Chapter03/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) -------------------------------------------------------------------------------- /Chapter03/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | sqlparse==0.4.2 4 | -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/comment8or/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/Activity4.02/comment8or/comment8or/__init__.py -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/Activity4.02/comment8or/messageboard/__init__.py -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | class MessageboardAdminConfig(AdminConfig): 4 | default_site = 'admin.Comment8orAdminSite' 5 | -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MessageboardConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'messageboard' 7 | -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/Activity4.02/comment8or/messageboard/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/urls.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/Activity4.02/comment8or/messageboard/urls.py -------------------------------------------------------------------------------- /Chapter04/Activity4.02/comment8or/messageboard/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Chapter04/CustomisingTheModelAdminClass/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdminSite(admin.AdminSite): 4 | title_header = 'Bookr Admin' 5 | site_header = 'Bookr administration' 6 | index_title = 'Bookr site admin' 7 | -------------------------------------------------------------------------------- /Chapter04/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdminSite(admin.AdminSite): 4 | title_header = 'Bookr Admin' 5 | site_header = 'Bookr administration' 6 | index_title = 'Bookr site admin' 7 | -------------------------------------------------------------------------------- /Chapter04/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter04/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter04/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | class ReviewsAdminConfig(AdminConfig): 4 | default_site = 'admin.BookrAdminSite' 5 | 6 | -------------------------------------------------------------------------------- /Chapter04/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'reviews' 7 | -------------------------------------------------------------------------------- /Chapter04/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter04/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter04/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter04/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter04/final/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('books/', views.book_list, name='book_list'), 6 | path('books//', views.book_detail, name='book_detail') 7 | ] 8 | -------------------------------------------------------------------------------- /Chapter04/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) -------------------------------------------------------------------------------- /Chapter04/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | sqlparse==0.4.2 4 | -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Activity5.01/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Activity5.01/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Activity5.01/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Activity5.01/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Activity5.01/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Activity5.01/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path("books/", views.book_list, name="book_list"), 7 | path("books//", views.book_detail, name="book_detail"), 8 | ] 9 | -------------------------------------------------------------------------------- /Chapter05/Activity5.01/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter05/Activity5.02/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter05/Activity5.03/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Activity5.03/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter05/Exercise5.01/business_site/business_site/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Exercise5.01/business_site/business_site/__init__.py -------------------------------------------------------------------------------- /Chapter05/Exercise5.01/business_site/landing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Exercise5.01/business_site/landing/__init__.py -------------------------------------------------------------------------------- /Chapter05/Exercise5.01/business_site/landing/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter05/Exercise5.01/business_site/landing/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class LandingConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "landing" 7 | -------------------------------------------------------------------------------- /Chapter05/Exercise5.01/business_site/landing/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Exercise5.01/business_site/landing/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter05/Exercise5.01/business_site/landing/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter05/Exercise5.01/business_site/landing/static/landing/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Exercise5.01/business_site/landing/static/landing/logo.png -------------------------------------------------------------------------------- /Chapter05/Exercise5.01/business_site/landing/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Chapter05/Exercise5.03/business_site/landing/static/landing/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/Exercise5.03/business_site/landing/static/landing/logo.png -------------------------------------------------------------------------------- /Chapter05/Exercise5.03/business_site/static/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | text-align: center; 4 | background-color: #f0f0f0; 5 | } 6 | -------------------------------------------------------------------------------- /Chapter05/Exercise5.04/business_site/static_production_test/placeholder: -------------------------------------------------------------------------------- 1 | Placeholder file because empty directories can't be added to git. 2 | -------------------------------------------------------------------------------- /Chapter05/Exercise5.05/business_site/static/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | text-align: center; 4 | background-color: #f0f0f0; 5 | } 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Chapter05/Exercise5.05/business_site/static_production_test/placeholder: -------------------------------------------------------------------------------- 1 | Placeholder file because empty directories can't be added to git. 2 | -------------------------------------------------------------------------------- /Chapter05/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter05/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path("books/", views.book_list, name="book_list"), 7 | path("books//", views.book_detail, name="book_detail"), 8 | ] 9 | -------------------------------------------------------------------------------- /Chapter05/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter05/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter05/final/business_site/business_site/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/business_site/business_site/__init__.py -------------------------------------------------------------------------------- /Chapter05/final/business_site/landing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/business_site/landing/__init__.py -------------------------------------------------------------------------------- /Chapter05/final/business_site/landing/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter05/final/business_site/landing/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class LandingConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "landing" 7 | -------------------------------------------------------------------------------- /Chapter05/final/business_site/landing/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/business_site/landing/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter05/final/business_site/landing/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter05/final/business_site/landing/static/landing/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter05/final/business_site/landing/static/landing/logo.png -------------------------------------------------------------------------------- /Chapter05/final/business_site/landing/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Chapter05/final/business_site/static/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | text-align: center; 4 | background-color: #f0f0f0; 5 | } 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Chapter05/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | sqlparse==0.4.2 4 | -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Activity6.01/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Activity6.01/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Activity6.01/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Activity6.01/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Activity6.01/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Activity6.01/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path("books/", views.book_list, name="book_list"), 7 | path("books//", views.book_detail, name="book_detail"), 8 | ] 9 | -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter06/Activity6.01/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Activity6.01/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter06/Exercise6.01/form_project/form_example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Exercise6.01/form_project/form_example/__init__.py -------------------------------------------------------------------------------- /Chapter06/Exercise6.01/form_project/form_example/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter06/Exercise6.01/form_project/form_example/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class FormExampleConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "form_example" 7 | -------------------------------------------------------------------------------- /Chapter06/Exercise6.01/form_project/form_example/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Exercise6.01/form_project/form_example/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter06/Exercise6.01/form_project/form_example/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter06/Exercise6.01/form_project/form_example/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def form_example(request): 5 | return render(request, "form-example.html") 6 | -------------------------------------------------------------------------------- /Chapter06/Exercise6.01/form_project/form_project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/Exercise6.01/form_project/form_project/__init__.py -------------------------------------------------------------------------------- /Chapter06/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter06/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path("books/", views.book_list, name="book_list"), 7 | path("books//", views.book_detail, name="book_detail"), 8 | ] 9 | -------------------------------------------------------------------------------- /Chapter06/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter06/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter06/final/form_project/form_example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/form_project/form_example/__init__.py -------------------------------------------------------------------------------- /Chapter06/final/form_project/form_example/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter06/final/form_project/form_example/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class FormExampleConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "form_example" 7 | -------------------------------------------------------------------------------- /Chapter06/final/form_project/form_example/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/form_project/form_example/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter06/final/form_project/form_example/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter06/final/form_project/form_project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter06/final/form_project/form_project/__init__.py -------------------------------------------------------------------------------- /Chapter06/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | sqlparse==0.4.2 4 | -------------------------------------------------------------------------------- /Chapter07/Activity7.02/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter07/Activity7.02/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Activity7.02/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter07/Activity7.02/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Activity7.02/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter07/Exercise7.01/form_project/form_example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.01/form_project/form_example/__init__.py -------------------------------------------------------------------------------- /Chapter07/Exercise7.01/form_project/form_example/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter07/Exercise7.01/form_project/form_example/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class FormExampleConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "form_example" 7 | -------------------------------------------------------------------------------- /Chapter07/Exercise7.01/form_project/form_example/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.01/form_project/form_example/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter07/Exercise7.01/form_project/form_example/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter07/Exercise7.01/form_project/form_project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.01/form_project/form_project/__init__.py -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.03/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.03/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.03/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.03/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.03/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.03/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter07/Exercise7.03/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/Exercise7.03/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter07/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter07/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter07/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter07/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter07/final/form_project/form_example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/form_project/form_example/__init__.py -------------------------------------------------------------------------------- /Chapter07/final/form_project/form_example/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter07/final/form_project/form_example/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class FormExampleConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "form_example" 7 | -------------------------------------------------------------------------------- /Chapter07/final/form_project/form_example/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/form_project/form_example/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter07/final/form_project/form_example/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter07/final/form_project/form_project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter07/final/form_project/form_project/__init__.py -------------------------------------------------------------------------------- /Chapter07/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | sqlparse==0.4.2 4 | -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Activity8.01/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Activity8.01/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Activity8.01/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Activity8.01/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Activity8.01/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Activity8.01/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Activity8.01/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter08/Activity8.01/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Activity8.01/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter08/Exercise8.01/media_project/media/test.txt: -------------------------------------------------------------------------------- 1 | Hello world! -------------------------------------------------------------------------------- /Chapter08/Exercise8.01/media_project/media_example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.01/media_project/media_example/__init__.py -------------------------------------------------------------------------------- /Chapter08/Exercise8.01/media_project/media_example/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.01/media_project/media_example/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MediaExampleConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "media_example" 7 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.01/media_project/media_example/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.01/media_project/media_example/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter08/Exercise8.01/media_project/media_example/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.01/media_project/media_example/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.01/media_project/media_project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.01/media_project/media_project/__init__.py -------------------------------------------------------------------------------- /Chapter08/Exercise8.02/media_project/media_example/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def media_example(request): 5 | return render(request, "media-example.html") 6 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.03/media_project/fixtures/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.03/media_project/fixtures/cover.jpg -------------------------------------------------------------------------------- /Chapter08/Exercise8.03/media_project/fixtures/sample.txt: -------------------------------------------------------------------------------- 1 | This is some sample text. -------------------------------------------------------------------------------- /Chapter08/Exercise8.03/media_project/media/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.03/media_project/media/cover.jpg -------------------------------------------------------------------------------- /Chapter08/Exercise8.04/media_project/media_example/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | 4 | class UploadForm(forms.Form): 5 | file_upload = forms.FileField() 6 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.05/media_project/media/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.05/media_project/media/cover.jpg -------------------------------------------------------------------------------- /Chapter08/Exercise8.05/media_project/media_example/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | 4 | class UploadForm(forms.Form): 5 | file_upload = forms.ImageField() 6 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.06/media_project/media/files/placeholder: -------------------------------------------------------------------------------- 1 | Placeholder file because empty directories can't be added to git. 2 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.06/media_project/media/images/placeholder: -------------------------------------------------------------------------------- 1 | Placeholder file because empty directories can't be added to git. 2 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.06/media_project/media_example/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | 4 | class UploadForm(forms.Form): 5 | image_upload = forms.ImageField() 6 | file_upload = forms.FileField() 7 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.06/media_project/media_example/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.06/media_project/media_example/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter08/Exercise8.06/media_project/media_example/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class ExampleModel(models.Model): 5 | image_field = models.ImageField(upload_to="images/") 6 | file_field = models.FileField(upload_to="files/") 7 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.07/media_project/media/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.07/media_project/media/cover.jpg -------------------------------------------------------------------------------- /Chapter08/Exercise8.07/media_project/media/files/placeholder: -------------------------------------------------------------------------------- 1 | Placeholder file because empty directories can't be added to git. 2 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.07/media_project/media/images/cover_8GmKBdR.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.07/media_project/media/images/cover_8GmKBdR.jpg -------------------------------------------------------------------------------- /Chapter08/Exercise8.07/media_project/media/images/cover_uf1yjUz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/Exercise8.07/media_project/media/images/cover_uf1yjUz.jpg -------------------------------------------------------------------------------- /Chapter08/Exercise8.07/media_project/media/images/placeholder: -------------------------------------------------------------------------------- 1 | Placeholder file because empty directories can't be added to git. 2 | -------------------------------------------------------------------------------- /Chapter08/Exercise8.07/media_project/media/test.txt: -------------------------------------------------------------------------------- 1 | Hello world! -------------------------------------------------------------------------------- /Chapter08/Exercise8.07/media_project/media_example/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | from .models import ExampleModel 4 | 5 | 6 | class UploadForm(forms.ModelForm): 7 | class Meta: 8 | model = ExampleModel 9 | fields = "__all__" 10 | -------------------------------------------------------------------------------- /Chapter08/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter08/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter08/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter08/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter08/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter08/final/media_project/fixtures/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/media_project/fixtures/cover.jpg -------------------------------------------------------------------------------- /Chapter08/final/media_project/fixtures/sample.txt: -------------------------------------------------------------------------------- 1 | This is some sample text. -------------------------------------------------------------------------------- /Chapter08/final/media_project/media/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/media_project/media/cover.jpg -------------------------------------------------------------------------------- /Chapter08/final/media_project/media/files/sample_oMGMUVy.txt: -------------------------------------------------------------------------------- 1 | This is some sample text. -------------------------------------------------------------------------------- /Chapter08/final/media_project/media/files/sample_vLDxpxz.txt: -------------------------------------------------------------------------------- 1 | This is some sample text. -------------------------------------------------------------------------------- /Chapter08/final/media_project/media/images/cover_8GmKBdR.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/media_project/media/images/cover_8GmKBdR.jpg -------------------------------------------------------------------------------- /Chapter08/final/media_project/media/images/cover_uf1yjUz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/media_project/media/images/cover_uf1yjUz.jpg -------------------------------------------------------------------------------- /Chapter08/final/media_project/media/test.txt: -------------------------------------------------------------------------------- 1 | Hello world! -------------------------------------------------------------------------------- /Chapter08/final/media_project/media_example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/media_project/media_example/__init__.py -------------------------------------------------------------------------------- /Chapter08/final/media_project/media_example/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter08/final/media_project/media_example/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MediaExampleConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "media_example" 7 | -------------------------------------------------------------------------------- /Chapter08/final/media_project/media_example/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | from .models import ExampleModel 4 | 5 | 6 | class UploadForm(forms.ModelForm): 7 | class Meta: 8 | model = ExampleModel 9 | fields = "__all__" 10 | -------------------------------------------------------------------------------- /Chapter08/final/media_project/media_example/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/media_project/media_example/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter08/final/media_project/media_example/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class ExampleModel(models.Model): 5 | image_field = models.ImageField(upload_to="images/") 6 | file_field = models.FileField(upload_to="files/") 7 | -------------------------------------------------------------------------------- /Chapter08/final/media_project/media_project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter08/final/media_project/media_project/__init__.py -------------------------------------------------------------------------------- /Chapter08/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | Pillow==9.0.1 4 | sqlparse==0.4.2 5 | -------------------------------------------------------------------------------- /Chapter09/Exercise9.01/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter09/Exercise9.02/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def profile(request): 5 | return render(request, 'profile.html') 6 | -------------------------------------------------------------------------------- /Chapter09/Exercise9.03/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter09/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter09/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter09/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter09/final/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter09/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter09/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter09/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter09/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter09/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter09/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter09/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter09/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter09/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter09/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter09/final/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter10/Activity10.01/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter10/Activity10.01/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter10/Exercise10.02/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter10/Exercise10.02/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter10/Exercise10.03/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration" 5 | logout_template = "admin/logout.html" -------------------------------------------------------------------------------- /Chapter10/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter10/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter10/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter10/final/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter10/final/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter10/final/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter10/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter10/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter10/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter10/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter10/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter10/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter10/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter10/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter10/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter10/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter10/final/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter11/Activit11.01/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter11/Exercise11.01/filter_demo/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Custom Filter Example 4 | 5 | {% load explode_filter %} 6 | 7 | {{ names|explode:"," }} 8 | 9 | -------------------------------------------------------------------------------- /Chapter11/Exercise11.01/filter_demo/templatetags/explode_filter.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | 3 | register = template.Library() 4 | 5 | @register.filter 6 | def explode(value, separator): 7 | return value.split(separator) -------------------------------------------------------------------------------- /Chapter11/Exercise11.01/filter_demo/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path('', views.index, name='index') 7 | ] -------------------------------------------------------------------------------- /Chapter11/Exercise11.01/filter_demo/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | def index(request): 4 | names = "john,doe,mark,swain" 5 | return render(request, "index.html", {'names': names}) -------------------------------------------------------------------------------- /Chapter11/Exercise11.02/filter_demo/templates/simple_tag_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple Tag Template Example 4 | 5 | 6 | {% load simple_tag %} 7 | {% greet_user "Hey there" username %} 8 | 9 | -------------------------------------------------------------------------------- /Chapter11/Exercise11.02/filter_demo/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path('', views.index, name='index'), 7 | path('greet', views.greeting_view, name='greeting') 8 | ] -------------------------------------------------------------------------------- /Chapter11/Exercise11.03/filter_demo/templates/book_list.html: -------------------------------------------------------------------------------- 1 |
    2 | {% for book in book_list %} 3 |
  • {{ book }}
  • 4 | {% endfor %} 5 |
-------------------------------------------------------------------------------- /Chapter11/Exercise11.04/book_management/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | from .models import Book 4 | 5 | class BookForm(forms.ModelForm): 6 | class Meta: 7 | model = Book 8 | fields = ['name', 'author'] -------------------------------------------------------------------------------- /Chapter11/Exercise11.04/book_management/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class Book(models.Model): 5 | name = models.CharField(max_length=255) 6 | author = models.CharField(max_length=50) -------------------------------------------------------------------------------- /Chapter11/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter11/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter11/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter11/final/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter11/final/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter11/final/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter11/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter11/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter11/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter11/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter11/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter11/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter11/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter11/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter11/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter11/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter11/final/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Activity12.01/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Activity12.01/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Activity12.01/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Activity12.01/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Activity12.01/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Activity12.01/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Activity12.01/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Activity12.01/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter12/Activity12.01/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter12/Activity12.01/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.01/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.01/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.01/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.01/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.01/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.01/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.01/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.01/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.01/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.02/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.02/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.02/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.02/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.02/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.02/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.02/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.02/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.02/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.03/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.03/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.03/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.03/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.03/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.03/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.03/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.03/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.03/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.04/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.04/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.04/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.04/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.04/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.04/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.04/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.04/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.04/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.05/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.05/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.05/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.05/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.05/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.05/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.05/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/Exercise12.05/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter12/Exercise12.05/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | -------------------------------------------------------------------------------- /Chapter12/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter12/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter12/final/bookr/bookr/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import render 3 | 4 | 5 | @login_required 6 | def profile(request): 7 | return render(request, 'profile.html') 8 | -------------------------------------------------------------------------------- /Chapter12/final/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter12/final/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter12/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter12/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter12/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter12/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter12/final/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter12/final/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | -------------------------------------------------------------------------------- /Chapter13/Activity13.01/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | XlsxWriter==1.3.2 8 | -------------------------------------------------------------------------------- /Chapter13/Exercise13.02/sample_output.csv: -------------------------------------------------------------------------------- 1 | name,age,gender 2 | Richard,32,M 3 | Mumzil,21,F 4 | Melinda,25,F 5 | -------------------------------------------------------------------------------- /Chapter13/Exercise13.03/requirements.txt: -------------------------------------------------------------------------------- 1 | XlsxWriter==1.3.1 2 | -------------------------------------------------------------------------------- /Chapter13/Exercise13.03/sample_workbook.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/Exercise13.03/sample_workbook.xlsx -------------------------------------------------------------------------------- /Chapter13/Exercise13.04/demo_page.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/Exercise13.04/demo_page.pdf -------------------------------------------------------------------------------- /Chapter13/Exercise13.05/requirements.txt: -------------------------------------------------------------------------------- 1 | plotly==4.9.0 2 | retrying==1.3.3 3 | six==1.15.0 4 | -------------------------------------------------------------------------------- /Chapter13/Exercise13.06/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | XlsxWriter==1.3.2 8 | -------------------------------------------------------------------------------- /Chapter13/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter13/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter13/final/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter13/final/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter13/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter13/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter13/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter13/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter13/final/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter13/final/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | XlsxWriter==1.3.2 8 | -------------------------------------------------------------------------------- /Chapter14/Activity14.01/reviews/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/Activity14.01/reviews/tests/__init__.py -------------------------------------------------------------------------------- /Chapter14/Exercise14.01/reviews/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | class TestSimpleComponent(TestCase): 4 | def test_basic_sum(self): 5 | assert 1+1 == 2 6 | -------------------------------------------------------------------------------- /Chapter14/Exercise14.02/bookr_test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/Exercise14.02/bookr_test/__init__.py -------------------------------------------------------------------------------- /Chapter14/Exercise14.02/bookr_test/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Chapter14/Exercise14.02/bookr_test/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BookrTestConfig(AppConfig): 5 | name = 'bookr_test' 6 | -------------------------------------------------------------------------------- /Chapter14/Exercise14.02/bookr_test/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/Exercise14.02/bookr_test/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter14/Exercise14.02/bookr_test/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Chapter14/Exercise14.03/bookr_test/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('test/greeting', views.greeting_view, name='greeting_view') 6 | ] 7 | -------------------------------------------------------------------------------- /Chapter14/Exercise14.03/bookr_test/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse 2 | 3 | 4 | def greeting_view(request): 5 | """Greet the user.""" 6 | return HttpResponse("Hey there, welcome to Bookr! Your one stop place to review books.") 7 | -------------------------------------------------------------------------------- /Chapter14/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter14/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter14/final/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter14/final/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter14/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/reviews/tests/__init__.py -------------------------------------------------------------------------------- /Chapter14/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter14/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter14/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter14/final/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter14/final/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | XlsxWriter==1.3.2 8 | -------------------------------------------------------------------------------- /Chapter15/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter15/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter15/final/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter15/final/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter15/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter15/final/bookr/media/book_covers/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/media/book_covers/logo.png -------------------------------------------------------------------------------- /Chapter15/final/bookr/media/book_samples/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/media/book_samples/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/reviews/tests/__init__.py -------------------------------------------------------------------------------- /Chapter15/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter15/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter15/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter15/final/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter15/final/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | XlsxWriter==1.3.2 8 | -------------------------------------------------------------------------------- /Chapter16/final/bookr/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | class BookrAdminSite(admin.AdminSite): 5 | title_header = "Bookr Admin" 6 | site_header = "Bookr administration" 7 | index_title = "Bookr site admin" 8 | -------------------------------------------------------------------------------- /Chapter16/final/bookr/bookr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/bookr/__init__.py -------------------------------------------------------------------------------- /Chapter16/final/bookr/bookr_admin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class BookrAdmin(admin.AdminSite): 4 | site_header = "Bookr Administration Portal" 5 | site_title = "Bookr Administration Portal" 6 | index_title = "Bookr Administration" -------------------------------------------------------------------------------- /Chapter16/final/bookr/bookr_admin/apps.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class BookrAdminConfig(AdminConfig): 5 | default_site = 'bookr_admin.admin.BookrAdmin' -------------------------------------------------------------------------------- /Chapter16/final/bookr/fixtures/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/fixtures/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter16/final/bookr/media/book_covers/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/media/book_covers/logo.png -------------------------------------------------------------------------------- /Chapter16/final/bookr/media/book_samples/machine-learning-for-trading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/media/book_samples/machine-learning-for-trading.pdf -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/reviews/__init__.py -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/adminconfig.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ReviewsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "reviews" 7 | -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/appsadmin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.admin.apps import AdminConfig 2 | 3 | 4 | class ReviewsAdminConfig(AdminConfig): 5 | default_site = "admin.BookrAdminSite" 6 | -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/reviews/management/__init__.py -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/reviews/management/commands/__init__.py -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/reviews/migrations/__init__.py -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/static/reviews/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/reviews/static/reviews/logo.png -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/templates/book_list.html: -------------------------------------------------------------------------------- 1 |

Books read

2 |
    3 | {% for book in books_read %} 4 |
  • {{ book }} 5 | {% endfor %} 6 |
-------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/templates/reviews/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block brand %}{% endblock %} -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/reviews/tests/__init__.py -------------------------------------------------------------------------------- /Chapter16/final/bookr/reviews/utils.py: -------------------------------------------------------------------------------- 1 | def average_rating(rating_list): 2 | if not rating_list: 3 | return 0 4 | 5 | return round(sum(rating_list) / len(rating_list)) 6 | -------------------------------------------------------------------------------- /Chapter16/final/bookr/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Chapter16/final/bookr/static/logo.png -------------------------------------------------------------------------------- /Chapter16/final/bookr/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n %} 3 | 4 | {% block content %} 5 |

{% translate 'Your password was changed.' %}

6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Chapter16/final/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.4.1 2 | Django==4.0 3 | djangorestframework==3.13.1 4 | Pillow==9.2.0 5 | pytz==2022.2.1 6 | sqlparse==0.4.2 7 | XlsxWriter==1.3.2 8 | -------------------------------------------------------------------------------- /Online Chapters/B18654_17.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Online Chapters/B18654_17.pdf -------------------------------------------------------------------------------- /Online Chapters/B18654_18.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Django-Second-Edition/a226881fc45de7845220f4e32418d3bb958fd5a0/Online Chapters/B18654_18.pdf --------------------------------------------------------------------------------