├── .gitignore ├── README.md ├── _chapters ├── _start_here.zip ├── _start_here │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── application.js │ │ │ ├── bootstrap.css │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery_ujs.js │ │ ├── templates │ │ │ ├── base.html │ │ │ ├── cardform.html │ │ │ ├── contact.html │ │ │ ├── edit.html │ │ │ ├── errors.html │ │ │ ├── field.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── home.html │ │ │ ├── index.html │ │ │ ├── register.html │ │ │ ├── sign_in.html │ │ │ ├── test.html │ │ │ └── user.html │ │ └── test.db │ └── requirements.txt ├── chp03 │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── application.js │ │ │ ├── bootstrap.css │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery_ujs.js │ │ ├── templates │ │ │ ├── base.html │ │ │ ├── cardform.html │ │ │ ├── contact.html │ │ │ ├── edit.html │ │ │ ├── errors.html │ │ │ ├── field.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── home.html │ │ │ ├── index.html │ │ │ ├── register.html │ │ │ ├── sign_in.html │ │ │ ├── test.html │ │ │ └── user.html │ │ └── test.db │ └── requirements.txt ├── chp04 │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── application.js │ │ │ ├── bootstrap.css │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery_ujs.js │ │ ├── templates │ │ │ ├── base.html │ │ │ ├── cardform.html │ │ │ ├── contact.html │ │ │ ├── edit.html │ │ │ ├── errors.html │ │ │ ├── field.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── home.html │ │ │ ├── index.html │ │ │ ├── register.html │ │ │ ├── sign_in.html │ │ │ ├── test.html │ │ │ └── user.html │ │ └── test.db │ └── requirements.txt ├── chp06 │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── application.js │ │ │ ├── bootstrap.css │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery_ujs.js │ │ ├── templates │ │ │ ├── base.html │ │ │ ├── cardform.html │ │ │ ├── contact.html │ │ │ ├── edit.html │ │ │ ├── errors.html │ │ │ ├── field.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── home.html │ │ │ ├── index.html │ │ │ ├── register.html │ │ │ ├── sign_in.html │ │ │ ├── test.html │ │ │ └── user.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ └── testMainPageView.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp07 │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── application.js │ │ │ ├── bootstrap.css │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery_ujs.js │ │ ├── templates │ │ │ ├── base.html │ │ │ ├── cardform.html │ │ │ ├── contact.html │ │ │ ├── edit.html │ │ │ ├── errors.html │ │ │ ├── field.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── home.html │ │ │ ├── index.html │ │ │ ├── register.html │ │ │ ├── sign_in.html │ │ │ ├── test.html │ │ │ └── user.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ └── testMainPageView.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp09 │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── fixtures │ │ │ │ └── initial_data.json │ │ │ ├── models.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ └── main_marketing.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── jquery-1.11.1.min.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ └── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ └── testMainPageView.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp10 │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── fixtures │ │ │ │ └── initial_data.json │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── initial_data.json │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── jquery-1.11.1.min.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ └── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp11 │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── fixtures │ │ │ │ └── initial_data.json │ │ │ ├── json_views.py │ │ │ ├── models.py │ │ │ ├── permissions.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── initial_data.json │ │ │ ├── forms.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── jquery-1.11.1.min.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ ├── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ │ └── rest_framework │ │ │ │ └── api.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testJSONViews.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp12 │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_statusreport.py │ │ │ │ ├── __init__.py │ │ │ │ └── data_load_marketing_items_0003.py │ │ │ ├── models.py │ │ │ ├── permissions.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0003_initial_data.py │ │ │ │ ├── 0004_auto_20141001_0546.py │ │ │ │ ├── 0005_bigcoId_migration.py │ │ │ │ ├── 0006_auto_20141007_0904.py │ │ │ │ ├── 0007_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── jquery-1.11.1.min.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ ├── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ │ └── rest_framework │ │ │ │ └── api.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testJSONViews.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp13 │ ├── angular_test │ │ ├── index.html │ │ └── polls.html │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_statusreport.py │ │ │ │ ├── __init__.py │ │ │ │ └── data_load_marketing_items_0003.py │ │ │ ├── models.py │ │ │ ├── permissions.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0003_initial_data.py │ │ │ │ ├── 0004_auto_20141001_0546.py │ │ │ │ ├── 0005_bigcoId_migration.py │ │ │ │ ├── 0006_auto_20141007_0904.py │ │ │ │ ├── 0007_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── jquery-1.11.1.min.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ ├── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ │ └── rest_framework │ │ │ │ └── api.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testJSONViews.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp14 │ ├── angular_test │ │ ├── index.html │ │ └── polls.html │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── djangular_polls │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_statusreport.py │ │ │ │ ├── __init__.py │ │ │ │ └── data_load_marketing_items_0003.py │ │ │ ├── models.py │ │ │ ├── permissions.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0003_initial_data.py │ │ │ │ ├── 0004_auto_20141001_0546.py │ │ │ │ ├── 0005_bigcoId_migration.py │ │ │ │ ├── 0006_auto_20141007_0904.py │ │ │ │ ├── 0007_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── angular.min.js │ │ │ │ ├── angular.min.js.map │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── jquery-1.11.1.min.js │ │ │ │ ├── loggedInCtrl.js │ │ │ │ └── userPollCtrl.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── djangular_polls │ │ │ │ └── _polls.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ ├── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ │ └── rest_framework │ │ │ │ └── api.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testJSONViews.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp15 │ ├── angular_test │ │ ├── index.html │ │ └── polls.html │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── djangular_polls │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_statusreport.py │ │ │ │ ├── __init__.py │ │ │ │ └── data_load_marketing_items_0003.py │ │ │ ├── models.py │ │ │ ├── permissions.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── forms.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0003_initial_data.py │ │ │ │ ├── 0004_auto_20141001_0546.py │ │ │ │ ├── 0005_bigcoId_migration.py │ │ │ │ ├── 0006_auto_20141007_0904.py │ │ │ │ ├── 0007_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── angular.min.js │ │ │ │ ├── angular.min.js.map │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── jquery-1.11.1.min.js │ │ │ │ ├── loggedInCtrl.js │ │ │ │ ├── registerCtrl.js │ │ │ │ └── userPollCtrl.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── djangular_polls │ │ │ │ └── _polls.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ ├── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ │ └── rest_framework │ │ │ │ └── api.html │ │ └── test.db │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testJSONViews.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp16 │ ├── angular_test │ │ ├── index.html │ │ └── polls.html │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── djangular_polls │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_statusreport.py │ │ │ │ ├── __init__.py │ │ │ │ └── data_load_marketing_items_0003.py │ │ │ ├── models.py │ │ │ ├── permissions.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── forms.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0003_initial_data.py │ │ │ │ ├── 0004_auto_20141001_0546.py │ │ │ │ ├── 0005_bigcoId_migration.py │ │ │ │ ├── 0006_auto_20141007_0904.py │ │ │ │ ├── 0007_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── angular-google-maps.min.js │ │ │ │ ├── angular.min.js │ │ │ │ ├── angular.min.js.map │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── jquery-1.11.1.min.js │ │ │ │ ├── lodash.underscore.min.js │ │ │ │ ├── loggedInCtrl.js │ │ │ │ ├── registerCtrl.js │ │ │ │ ├── userMapCtrl.js │ │ │ │ └── userPollCtrl.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── djangular_polls │ │ │ │ └── _polls.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ ├── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ │ ├── rest_framework │ │ │ │ └── api.html │ │ │ └── usermap │ │ │ │ └── usermap.html │ │ ├── test.db │ │ └── usermap │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testJSONViews.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp17 │ ├── angular_test │ │ ├── index.html │ │ └── polls.html │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── djangular_polls │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_remove_pollitem_percentage.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_auto_20150311_1303.py │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150311_1313.py │ │ │ │ ├── 0002_statusreport.py │ │ │ │ ├── __init__.py │ │ │ │ └── data_load_marketing_items_0003.py │ │ │ ├── models.py │ │ │ ├── permissions.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── media │ │ │ ├── announce │ │ │ │ └── main-logo.png │ │ │ └── images │ │ │ │ └── fig.png │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── forms.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0003_initial_data.py │ │ │ │ ├── 0004_auto_20141001_0546.py │ │ │ │ ├── 0005_bigcoId_migration.py │ │ │ │ ├── 0006_auto_20141007_0904.py │ │ │ │ ├── 0007_auto_20150311_1303.py │ │ │ │ ├── 0007_auto_20150606_0307.py │ │ │ │ ├── 0008_auto_20150311_1313.py │ │ │ │ ├── 0009_merge.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── admin.js │ │ │ │ ├── angular-google-maps.min.js │ │ │ │ ├── angular.min.js │ │ │ │ ├── angular.min.js.map │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── jquery-1.11.1.min.js │ │ │ │ ├── lodash.underscore.min.js │ │ │ │ ├── loggedInCtrl.js │ │ │ │ ├── registerCtrl.js │ │ │ │ ├── ui-bootstrap-tpls-0.11.0.min.js │ │ │ │ ├── ui-bootstrap-tpls.min.js │ │ │ │ ├── userMapCtrl.js │ │ │ │ └── userPollCtrl.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── admin │ │ │ │ └── payments │ │ │ │ │ └── user │ │ │ │ │ └── change_form.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── djangular_polls │ │ │ │ └── _polls.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ ├── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ │ ├── rest_framework │ │ │ │ └── api.html │ │ │ └── usermap │ │ │ │ └── usermap.html │ │ ├── test.db │ │ └── usermap │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testJSONViews.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py ├── chp18 │ ├── angular_test │ │ ├── index.html │ │ └── polls.html │ ├── django_ecommerce │ │ ├── contact │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150606_0307.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── views.py │ │ ├── db_backup.json │ │ ├── django_ecommerce │ │ │ ├── __init__.py │ │ │ ├── guitest_settings.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── djangular_polls │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_remove_pollitem_percentage.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── main │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_auto_20150311_1303.py │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0002_auto_20150311_1313.py │ │ │ │ ├── 0002_statusreport.py │ │ │ │ ├── 0003_auto_20150606_0720.py │ │ │ │ ├── __init__.py │ │ │ │ └── data_load_marketing_items_0003.py │ │ │ ├── models.py │ │ │ ├── permissions.py │ │ │ ├── serializers.py │ │ │ ├── templatetags │ │ │ │ ├── __init__.py │ │ │ │ ├── main_gravatar.py │ │ │ │ └── main_marketing.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ ├── media │ │ │ ├── announce │ │ │ │ └── main-logo.png │ │ │ └── images │ │ │ │ └── fig.png │ │ ├── payments │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── fixtures │ │ │ │ └── system_data.json │ │ │ ├── forms.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── 0003_initial_data.py │ │ │ │ ├── 0004_auto_20141001_0546.py │ │ │ │ ├── 0005_bigcoId_migration.py │ │ │ │ ├── 0006_auto_20141007_0904.py │ │ │ │ ├── 0007_auto_20150311_1303.py │ │ │ │ ├── 0007_auto_20150606_0307.py │ │ │ │ ├── 0008_auto_20150311_1313.py │ │ │ │ ├── 0009_merge.py │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── serializers.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── requirements.txt │ │ ├── runner.py │ │ ├── static │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── mec.css │ │ │ │ └── signin.css │ │ │ ├── fonts │ │ │ │ ├── Starjedi.eot │ │ │ │ ├── Starjedi.svg │ │ │ │ ├── Starjedi.ttf │ │ │ │ ├── Starjedi.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── img │ │ │ │ ├── clone_army.jpg │ │ │ │ ├── darth.jpg │ │ │ │ ├── leia.jpg │ │ │ │ ├── star-wars-battle.jpg │ │ │ │ ├── star-wars-cast.jpg │ │ │ │ └── yoda.jpg │ │ │ └── js │ │ │ │ ├── admin.js │ │ │ │ ├── angular-google-maps.min.js │ │ │ │ ├── angular.min.js │ │ │ │ ├── angular.min.js.map │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── jquery-1.11.1.min.js │ │ │ │ ├── lodash.underscore.min.js │ │ │ │ ├── loggedInCtrl.js │ │ │ │ ├── registerCtrl.js │ │ │ │ ├── ui-bootstrap-tpls-0.11.0.min.js │ │ │ │ ├── ui-bootstrap-tpls.min.js │ │ │ │ ├── userMapCtrl.js │ │ │ │ └── userPollCtrl.js │ │ ├── templates │ │ │ ├── __base.html │ │ │ ├── admin │ │ │ │ └── payments │ │ │ │ │ └── user │ │ │ │ │ └── change_form.html │ │ │ ├── contact │ │ │ │ └── contact.html │ │ │ ├── djangular_polls │ │ │ │ └── _polls.html │ │ │ ├── flatpages │ │ │ │ └── default.html │ │ │ ├── main │ │ │ │ ├── _announcements.html │ │ │ │ ├── _badges.html │ │ │ │ ├── _jedibadge.html │ │ │ │ ├── _lateststatus.html │ │ │ │ ├── _statusupdate.html │ │ │ │ ├── index.html │ │ │ │ ├── templatetags │ │ │ │ │ └── circle_item.html │ │ │ │ └── user.html │ │ │ ├── payments │ │ │ │ ├── _cardform.html │ │ │ │ ├── _field.html │ │ │ │ ├── edit.html │ │ │ │ ├── errors.html │ │ │ │ ├── register.html │ │ │ │ └── sign_in.html │ │ │ ├── rest_framework │ │ │ │ └── api.html │ │ │ └── usermap │ │ │ │ └── usermap.html │ │ ├── test.db │ │ └── usermap │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── json_views.py │ │ │ ├── migrations │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── gui │ │ ├── __init__.py │ │ └── pages │ │ │ ├── __init__.py │ │ │ └── testPage.py │ │ └── unit │ │ ├── __init__.py │ │ ├── contact │ │ ├── __init__.py │ │ └── testContactModels.py │ │ ├── main │ │ ├── __init__.py │ │ ├── testJSONViews.py │ │ ├── testMainPageView.py │ │ └── testSerializers.py │ │ └── payments │ │ ├── __init__.py │ │ ├── testCustomer.py │ │ ├── testForms.py │ │ ├── testUserModel.py │ │ └── testViews.py └── chp19 │ ├── angular_test │ ├── index.html │ └── polls.html │ ├── deploy │ ├── fabfile.py │ ├── gunicorn_start │ ├── nginx │ │ └── sites-available │ │ │ └── mec │ ├── settings_prod.py │ └── supervisor │ │ └── mec.conf │ ├── django_ecommerce │ ├── contact │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── forms.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_auto_20150606_0307.py │ │ │ └── __init__.py │ │ ├── models.py │ │ └── views.py │ ├── db_backup.json │ ├── django_ecommerce │ │ ├── __init__.py │ │ ├── guitest_settings.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ ├── djangular_polls │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── json_views.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_remove_pollitem_percentage.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── serializers.py │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ ├── main │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── fixtures │ │ │ └── system_data.json │ │ ├── json_views.py │ │ ├── migrations │ │ │ ├── 0001_auto_20150311_1303.py │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_auto_20150311_1313.py │ │ │ ├── 0002_statusreport.py │ │ │ ├── 0003_auto_20150606_0720.py │ │ │ ├── __init__.py │ │ │ └── data_load_marketing_items_0003.py │ │ ├── models.py │ │ ├── permissions.py │ │ ├── serializers.py │ │ ├── templatetags │ │ │ ├── __init__.py │ │ │ ├── main_gravatar.py │ │ │ └── main_marketing.py │ │ ├── urls.py │ │ └── views.py │ ├── manage.py │ ├── media │ │ ├── announce │ │ │ └── main-logo.png │ │ └── images │ │ │ └── fig.png │ ├── payments │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── fixtures │ │ │ └── system_data.json │ │ ├── forms.py │ │ ├── json_views.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0003_initial_data.py │ │ │ ├── 0004_auto_20141001_0546.py │ │ │ ├── 0005_bigcoId_migration.py │ │ │ ├── 0006_auto_20141007_0904.py │ │ │ ├── 0007_auto_20150311_1303.py │ │ │ ├── 0007_auto_20150606_0307.py │ │ │ ├── 0008_auto_20150311_1313.py │ │ │ ├── 0009_merge.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── serializers.py │ │ ├── urls.py │ │ └── views.py │ ├── requirements.txt │ ├── runner.py │ ├── static │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ ├── mec.css │ │ │ └── signin.css │ │ ├── fonts │ │ │ ├── Starjedi.eot │ │ │ ├── Starjedi.svg │ │ │ ├── Starjedi.ttf │ │ │ ├── Starjedi.woff │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── img │ │ │ ├── clone_army.jpg │ │ │ ├── darth.jpg │ │ │ ├── leia.jpg │ │ │ ├── star-wars-battle.jpg │ │ │ ├── star-wars-cast.jpg │ │ │ └── yoda.jpg │ │ └── js │ │ │ ├── admin.js │ │ │ ├── angular-google-maps.min.js │ │ │ ├── angular.min.js │ │ │ ├── angular.min.js.map │ │ │ ├── application.js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ ├── jquery-1.11.1.min.js │ │ │ ├── lodash.underscore.min.js │ │ │ ├── loggedInCtrl.js │ │ │ ├── registerCtrl.js │ │ │ ├── ui-bootstrap-tpls-0.11.0.min.js │ │ │ ├── ui-bootstrap-tpls.min.js │ │ │ ├── userMapCtrl.js │ │ │ └── userPollCtrl.js │ ├── templates │ │ ├── __base.html │ │ ├── admin │ │ │ └── payments │ │ │ │ └── user │ │ │ │ └── change_form.html │ │ ├── contact │ │ │ └── contact.html │ │ ├── djangular_polls │ │ │ └── _polls.html │ │ ├── flatpages │ │ │ └── default.html │ │ ├── main │ │ │ ├── _announcements.html │ │ │ ├── _badges.html │ │ │ ├── _jedibadge.html │ │ │ ├── _lateststatus.html │ │ │ ├── _statusupdate.html │ │ │ ├── index.html │ │ │ ├── templatetags │ │ │ │ └── circle_item.html │ │ │ └── user.html │ │ ├── payments │ │ │ ├── _cardform.html │ │ │ ├── _field.html │ │ │ ├── edit.html │ │ │ ├── errors.html │ │ │ ├── register.html │ │ │ └── sign_in.html │ │ ├── rest_framework │ │ │ └── api.html │ │ └── usermap │ │ │ └── usermap.html │ ├── test.db │ └── usermap │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── json_views.py │ │ ├── migrations │ │ └── __init__.py │ │ ├── models.py │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ ├── requirements.txt │ └── tests │ ├── __init__.py │ ├── gui │ ├── __init__.py │ └── pages │ │ ├── __init__.py │ │ └── testPage.py │ └── unit │ ├── __init__.py │ ├── contact │ ├── __init__.py │ └── testContactModels.py │ ├── main │ ├── __init__.py │ ├── testJSONViews.py │ ├── testMainPageView.py │ └── testSerializers.py │ └── payments │ ├── __init__.py │ ├── testCustomer.py │ ├── testForms.py │ ├── testUserModel.py │ └── testViews.py ├── django_ecommerce ├── contact │ ├── __init__.py │ ├── admin.py │ ├── forms.py │ ├── models.py │ └── views.py ├── django_ecommerce │ ├── __init__.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── main │ ├── __init__.py │ ├── fixtures │ │ └── system_data.json │ ├── json_views.py │ ├── models.py │ ├── permissions.py │ ├── serializers.py │ ├── templatetags │ │ ├── __init__.py │ │ ├── main_gravatar.py │ │ └── main_marketing.py │ ├── urls.py │ └── views.py ├── manage.py ├── payments │ ├── __init__.py │ ├── admin.py │ ├── fixtures │ │ └── system_data.json │ ├── forms.py │ ├── models.py │ └── views.py ├── static │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── carousel.css │ │ ├── mec.css │ │ └── signin.css │ ├── fonts │ │ ├── Starjedi.eot │ │ ├── Starjedi.svg │ │ ├── Starjedi.ttf │ │ ├── Starjedi.woff │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ ├── img │ │ ├── badge_force.jpg │ │ ├── badge_jedi.png │ │ ├── badge_padwan.png │ │ ├── badge_trooper.jpg │ │ ├── badge_vader.jpg │ │ ├── beat_jarjar.jpg │ │ ├── clone_army.jpg │ │ ├── darth.jpg │ │ ├── leia.jpg │ │ ├── star-wars-battle.jpg │ │ ├── star-wars-cast.jpg │ │ └── yoda.jpg │ └── js │ │ ├── application.js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.11.0.js │ │ ├── jquery-1.11.0.min.js │ │ ├── jquery_ujs.js │ │ ├── registerCtrl.js │ │ └── ui-bootstrap-tpls-0.11.0.min.js └── templates │ ├── __base.html │ ├── contact │ └── contact.html │ ├── flatpages │ └── default.html │ ├── main │ ├── _announcements.html │ ├── _badges.html │ ├── _jedibadge.html │ ├── _lateststatus.html │ ├── _statusupdate.html │ ├── index.html │ ├── templatetags │ │ └── circle_item.html │ └── user.html │ ├── payments │ ├── _cardform.html │ ├── _field.html │ ├── edit.html │ ├── register.html │ └── sign_in.html │ └── rest_framework │ └── api.html ├── repo.zip ├── requirements.txt └── tests ├── __init__.py ├── contact ├── __init__.py └── testContactModels.py ├── main ├── __init__.py ├── testJsonViews.py ├── testMainPageView.py ├── testModels.py └── testSerializers.py └── payments ├── __init__.py ├── testCustomer.py ├── testForms.py ├── testUserModel.py └── testViews.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | .DS_Store 3 | env 4 | py3 5 | *.bak -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | mvp_for_Adv_Python_Web_Book 2 | =========================== 3 | 4 | This is the sample application that is used throughout the Adv Python for the web book. 5 | -------------------------------------------------------------------------------- /_chapters/_start_here.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/_start_here.zip -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/_start_here/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | model = ContactForm 11 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/contact/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file demonstrates writing tests using the unittest module. These will pass 3 | when you run "manage.py test". 4 | 5 | Replace this with more appropriate tests for your application. 6 | """ 7 | 8 | from django.test import TestCase 9 | 10 | 11 | class SimpleTest(TestCase): 12 | def test_basic_addition(self): 13 | """ 14 | Tests that 1 + 1 always equals 2. 15 | """ 16 | self.assertEqual(1 + 1, 2) 17 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/_start_here/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/_start_here/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/main/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/main/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file demonstrates writing tests using the unittest module. These will pass 3 | when you run "manage.py test". 4 | 5 | Replace this with more appropriate tests for your application. 6 | """ 7 | 8 | from django.test import TestCase 9 | 10 | 11 | class SimpleTest(TestCase): 12 | def test_basic_addition(self): 13 | """ 14 | Tests that 1 + 1 always equals 2. 15 | """ 16 | self.assertEqual(1 + 1, 2) 17 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/main/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | from payments.models import User 3 | 4 | 5 | def index(request): 6 | uid = request.session.get('user') 7 | if uid is None: 8 | return render_to_response('index.html') 9 | else: 10 | return render_to_response( 11 | 'user.html', 12 | {'user': User.objects.get(pk=uid)} 13 | ) 14 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/_start_here/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/payments/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file demonstrates writing tests using the unittest module. These will pass 3 | when you run "manage.py test". 4 | 5 | Replace this with more appropriate tests for your application. 6 | """ 7 | 8 | from django.test import TestCase 9 | 10 | 11 | class SimpleTest(TestCase): 12 | def test_basic_addition(self): 13 | """ 14 | Tests that 1 + 1 always equals 2. 15 | """ 16 | self.assertEqual(1 + 1, 2) 17 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/templates/contact.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 |

Contact Us

7 | 8 |
9 | {% csrf_token %} 10 | {{ form.as_table }} 11 |
12 | 13 |
14 | 15 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/templates/errors.html: -------------------------------------------------------------------------------- 1 | {% if form.is_bound and not form.is_valid %} 2 |
3 |
4 | {% for field in form.visible_fields %} 5 | {% for error in field.errors %} 6 |

{{ field.label }}: {{ error }}

7 | {% endfor %} 8 | {% endfor %} 9 | {% for error in form.non_field_errors %} 10 |

{{ error }}

11 | {% endfor %} 12 |
13 |
14 | {% endif %} -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/templates/field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/templates/test.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 | {% email %} 7 | 8 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/templates/user.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 |
5 |
6 |
7 |

Member's Only Page


8 |

Welcome {{ user.name }}.

9 |

Click here to make changes to your credit card.

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /_chapters/_start_here/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/_start_here/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/_start_here/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.5.5 2 | mock==1.0.1 3 | requests==2.3.0 4 | stripe==1.9.2 5 | wsgiref==0.1.2 6 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp03/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | model = ContactForm 11 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/contact/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file demonstrates writing tests using the unittest module. These will pass 3 | when you run "manage.py test". 4 | 5 | Replace this with more appropriate tests for your application. 6 | """ 7 | 8 | from django.test import TestCase 9 | 10 | 11 | class SimpleTest(TestCase): 12 | def test_basic_addition(self): 13 | """ 14 | Tests that 1 + 1 always equals 2. 15 | """ 16 | self.assertEqual(1 + 1, 2) 17 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp03/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp03/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/main/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/main/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | from payments.models import User 3 | 4 | 5 | def index(request): 6 | uid = request.session.get('user') 7 | if uid is None: 8 | return render_to_response('index.html') 9 | else: 10 | return render_to_response( 11 | 'user.html', {'user': User.get_by_id(uid)} 12 | ) 13 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp03/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/templates/contact.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 |

Contact Us

7 | 8 |
9 | {% csrf_token %} 10 | {{ form.as_table }} 11 |
12 | 13 |
14 | 15 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/templates/errors.html: -------------------------------------------------------------------------------- 1 | {% if form.is_bound and not form.is_valid %} 2 |
3 |
4 | {% for field in form.visible_fields %} 5 | {% for error in field.errors %} 6 |

{{ field.label }}: {{ error }}

7 | {% endfor %} 8 | {% endfor %} 9 | {% for error in form.non_field_errors %} 10 |

{{ error }}

11 | {% endfor %} 12 |
13 |
14 | {% endif %} -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/templates/field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/templates/test.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 | {% email %} 7 | 8 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/templates/user.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 |
5 |
6 |
7 |

Member's Only Page


8 |

Welcome {{ user.name }}.

9 |

Click here to make changes to your credit card.

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /_chapters/chp03/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp03/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp03/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.5.5 2 | mock==1.0.1 3 | requests==2.3.0 4 | stripe==1.9.2 5 | wsgiref==0.1.2 6 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp04/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | model = ContactForm 11 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp04/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp04/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/main/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/main/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | from payments.models import User 3 | 4 | 5 | def index(request): 6 | uid = request.session.get('user') 7 | if uid is None: 8 | return render_to_response('index.html') 9 | else: 10 | return render_to_response( 11 | 'user.html', {'user': User.get_by_id(uid)} 12 | ) 13 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp04/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/templates/contact.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 |

Contact Us

7 | 8 |
9 | {% csrf_token %} 10 | {{ form.as_table }} 11 |
12 | 13 |
14 | 15 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/templates/errors.html: -------------------------------------------------------------------------------- 1 | {% if form.is_bound and not form.is_valid %} 2 |
3 |
4 | {% for field in form.visible_fields %} 5 | {% for error in field.errors %} 6 |

{{ field.label }}: {{ error }}

7 | {% endfor %} 8 | {% endfor %} 9 | {% for error in form.non_field_errors %} 10 |

{{ error }}

11 | {% endfor %} 12 |
13 |
14 | {% endif %} -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/templates/field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/templates/test.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 | {% email %} 7 | 8 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/templates/user.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 |
5 |
6 |
7 |

Member's Only Page


8 |

Welcome {{ user.name }}.

9 |

Click here to make changes to your credit card.

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /_chapters/chp04/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp04/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp04/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.5.5 2 | mock==1.0.1 3 | requests==2.3.0 4 | stripe==1.9.2 5 | wsgiref==0.1.2 6 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/main/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/main/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | from payments.models import User 3 | 4 | 5 | def index(request): 6 | uid = request.session.get('user') 7 | if uid is None: 8 | return render_to_response('index.html') 9 | else: 10 | return render_to_response( 11 | 'user.html', {'user': User.get_by_id(uid)} 12 | ) 13 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/templates/contact.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 |

Contact Us

7 | 8 |
9 | {% csrf_token %} 10 | {{ form.as_table }} 11 |
12 | 13 |
14 | 15 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/templates/errors.html: -------------------------------------------------------------------------------- 1 | {% if form.is_bound and not form.is_valid %} 2 |
3 |
4 | {% for field in form.visible_fields %} 5 | {% for error in field.errors %} 6 |

{{ field.label }}: {{ error }}

7 | {% endfor %} 8 | {% endfor %} 9 | {% for error in form.non_field_errors %} 10 |

{{ error }}

11 | {% endfor %} 12 |
13 |
14 | {% endif %} -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/templates/field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/templates/test.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 | {% email %} 7 | 8 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/templates/user.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 |
5 |
6 |
7 |

Member's Only Page


8 |

Welcome {{ user.name }}.

9 |

Click here to make changes to your credit card.

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /_chapters/chp06/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp06/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | mock==1.0.1 3 | psycopg2==2.5.4 4 | requests==2.3.0 5 | stripe==1.9.2 6 | -------------------------------------------------------------------------------- /_chapters/chp06/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp06/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp06/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp06/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp06/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/main/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/main/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | from payments.models import User 3 | 4 | 5 | def index(request): 6 | uid = request.session.get('user') 7 | if uid is None: 8 | return render_to_response('index.html') 9 | else: 10 | return render_to_response( 11 | 'user.html', {'user': User.get_by_id(uid)} 12 | ) 13 | -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/templates/contact.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 |

Contact Us

7 | 8 |
9 | {% csrf_token %} 10 | {{ form.as_table }} 11 |
12 | 13 |
14 | 15 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/templates/errors.html: -------------------------------------------------------------------------------- 1 | {% if form.is_bound and not form.is_valid %} 2 |
3 |
4 | {% for field in form.visible_fields %} 5 | {% for error in field.errors %} 6 |

{{ field.label }}: {{ error }}

7 | {% endfor %} 8 | {% endfor %} 9 | {% for error in form.non_field_errors %} 10 |

{{ error }}

11 | {% endfor %} 12 |
13 |
14 | {% endif %} -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/templates/field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/templates/test.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block content %} 5 | 6 | {% email %} 7 | 8 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/templates/user.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 |
5 |
6 |
7 |

Member's Only Page


8 |

Welcome {{ user.name }}.

9 |

Click here to make changes to your credit card.

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /_chapters/chp07/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp07/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | mock==1.0.1 3 | psycopg2==2.5.4 4 | requests==2.3.0 5 | stripe==1.9.2 6 | -------------------------------------------------------------------------------- /_chapters/chp07/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp07/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp07/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp07/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp07/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/main/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | # Create your models here. 5 | class MarketingItem(models.Model): 6 | img = models.CharField(max_length=255) 7 | heading = models.CharField(max_length=300) 8 | caption = models.TextField() 9 | button_link = models.URLField(null=True, default="register") 10 | button_title = models.CharField(max_length=20, default="View details") 11 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/templates/main/user.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | {% block content %} 3 |
4 |
5 |
6 |
7 |

Member's Only Page


8 |

Welcome {{ user.name }}.

9 |

Click here to make changes to your credit card.

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/templates/payments/_field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp09/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp09/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | mock==1.0.1 3 | psycopg2==2.5.3 4 | requests==2.3.0 5 | stripe==1.9.2 6 | -------------------------------------------------------------------------------- /_chapters/chp09/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp09/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp09/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/templates/payments/_field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp10/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp10/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | django-embed-video==0.11 3 | mock==1.0.1 4 | psycopg2==2.5.3 5 | requests==2.3.0 6 | stripe==1.9.2 7 | -------------------------------------------------------------------------------- /_chapters/chp10/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp10/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp10/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/templates/payments/_field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp11/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp11/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | django-embed-video==0.11 3 | djangorestframework==2.4.2 4 | mock==1.0.1 5 | psycopg2==2.5.3 6 | requests==2.3.0 7 | stripe==1.9.2 8 | -------------------------------------------------------------------------------- /_chapters/chp11/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp11/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp11/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/contact/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/contact/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/main/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/main/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/payments/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/payments/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/templates/payments/_field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp12/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp12/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | django-embed-video==0.11 3 | djangorestframework==2.4.2 4 | mock==1.0.1 5 | psycopg2==2.5.3 6 | requests==2.3.0 7 | stripe==1.9.2 8 | -------------------------------------------------------------------------------- /_chapters/chp12/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp12/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp12/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/contact/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/contact/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/main/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/main/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/payments/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/payments/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/templates/payments/_field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp13/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp13/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | django-embed-video==0.11 3 | djangorestframework==2.4.2 4 | mock==1.0.1 5 | psycopg2==2.5.3 6 | requests==2.3.0 7 | stripe==1.9.2 8 | -------------------------------------------------------------------------------- /_chapters/chp13/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp13/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp13/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/contact/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/contact/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/contact/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class ContactForm(models.Model): 4 | name = models.CharField(max_length=150) 5 | email = models.EmailField(max_length=250) 6 | topic = models.CharField(max_length=200) 7 | message = models.CharField(max_length=1000) 8 | timestamp = models.DateTimeField(auto_now_add=True) 9 | 10 | def __str__(self): 11 | return self.email 12 | 13 | class Meta: 14 | ordering = ['-timestamp'] 15 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/djangular_polls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/djangular_polls/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/djangular_polls/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/djangular_polls/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/djangular_polls/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/djangular_polls/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/djangular_polls/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/main/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/main/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/payments/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/payments/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/static/js/loggedInCtrl.js: -------------------------------------------------------------------------------- 1 | mecApp.controller('LoggedInCtrl', function($scope) { 2 | $scope.show_badges = false ; 3 | $scope.show_hide_label = "Show"; 4 | 5 | $scope.show = function() { 6 | $scope.show_badges = ! $scope.show_badges; 7 | $scope.show_hide_label = ($scope.show_badges) ? 'Hide': 'Show'; 8 | } 9 | }); -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/templates/payments/_field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /_chapters/chp14/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp14/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | django-embed-video==0.11 3 | djangorestframework==2.4.2 4 | mock==1.0.1 5 | psycopg2==2.5.3 6 | requests==2.3.0 7 | stripe==1.9.2 8 | -------------------------------------------------------------------------------- /_chapters/chp14/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp14/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp14/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/contact/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/contact/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/djangular_polls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/djangular_polls/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/djangular_polls/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/djangular_polls/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/djangular_polls/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/djangular_polls/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/djangular_polls/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/main/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/main/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/payments/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/payments/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/payments/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | 4 | urlpatterns = patterns( 5 | 'payments.json_views', 6 | url(r'^users$', 'post_user'), 7 | ) 8 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/static/js/loggedInCtrl.js: -------------------------------------------------------------------------------- 1 | mecApp.controller('LoggedInCtrl', function($scope) { 2 | $scope.show_badges = false ; 3 | $scope.show_hide_label = "Show"; 4 | 5 | $scope.show = function() { 6 | $scope.show_badges = ! $scope.show_badges; 7 | $scope.show_hide_label = ($scope.show_badges) ? 'Hide': 'Show'; 8 | } 9 | }); -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp15/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp15/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | django-embed-video==0.11 3 | djangorestframework==2.4.2 4 | mock==1.0.1 5 | psycopg2==2.5.3 6 | requests==2.3.0 7 | stripe==1.9.2 8 | -------------------------------------------------------------------------------- /_chapters/chp15/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp15/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp15/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/contact/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/contact/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/djangular_polls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/djangular_polls/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/djangular_polls/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/djangular_polls/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/djangular_polls/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/djangular_polls/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/djangular_polls/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/main/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/main/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User, UserAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/payments/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/payments/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/payments/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | 4 | urlpatterns = patterns( 5 | 'payments.json_views', 6 | url(r'^users$', 'post_user'), 7 | ) 8 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/static/js/loggedInCtrl.js: -------------------------------------------------------------------------------- 1 | mecApp.controller('LoggedInCtrl', function($scope) { 2 | $scope.show_badges = false ; 3 | $scope.show_hide_label = "Show"; 4 | 5 | $scope.show = function() { 6 | $scope.show_badges = ! $scope.show_badges; 7 | $scope.show_hide_label = ($scope.show_badges) ? 'Hide': 'Show'; 8 | } 9 | }); -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/usermap/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/usermap/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/usermap/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/usermap/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/django_ecommerce/usermap/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/usermap/models.py: -------------------------------------------------------------------------------- 1 | from mongoengine.document import Document 2 | from mongoengine.fields import EmailField, StringField, \ 3 | PointField, SequenceField 4 | 5 | 6 | class UserLocation(Document): 7 | email = EmailField(required=True, unique=True, max_length=200) 8 | name = StringField(required=True, max_length=200) 9 | location = PointField(required=True) 10 | mappoint_id = SequenceField(required=True) 11 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/usermap/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/usermap/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | 4 | urlpatterns = patterns( 5 | 'usermap.json_views', 6 | url(r'^user_locations$', 'user_locations_list'), 7 | ) 8 | -------------------------------------------------------------------------------- /_chapters/chp16/django_ecommerce/usermap/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | 3 | 4 | def usermap(request): 5 | return render_to_response('usermap/usermap.html') 6 | -------------------------------------------------------------------------------- /_chapters/chp16/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | django-embed-video==0.11 3 | django-rest-framework-mongoengine==1.5.4 4 | djangorestframework==2.4.2 5 | mock==1.0.1 6 | mongoengine==0.8.7 7 | psycopg2==2.5.3 8 | pymongo==2.7.2 9 | requests==2.3.0 10 | stripe==1.9.2 11 | -------------------------------------------------------------------------------- /_chapters/chp16/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp16/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp16/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/contact/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/contact/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/djangular_polls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/djangular_polls/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/djangular_polls/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/djangular_polls/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/djangular_polls/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/djangular_polls/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/main/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/main/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/media/announce/main-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/media/announce/main-logo.png -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/media/images/fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/media/images/fig.png -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/payments/migrations/0009_merge.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import models, migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('payments', '0007_auto_20150606_0307'), 11 | ('payments', '0008_auto_20150311_1313'), 12 | ] 13 | 14 | operations = [ 15 | ] 16 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/payments/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/payments/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/payments/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from .json_views import ChangePassword 3 | 4 | 5 | urlpatterns = patterns( 6 | 'payments.json_views', 7 | url(r'^users$', 'post_user'), 8 | url(r'^users/password/(?P[0-9]+)$', ChangePassword.as_view(), 9 | name='change_password'), 10 | ) 11 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/static/js/loggedInCtrl.js: -------------------------------------------------------------------------------- 1 | mecApp.controller('LoggedInCtrl', function($scope) { 2 | $scope.show_badges = false ; 3 | $scope.show_hide_label = "Show"; 4 | 5 | $scope.show = function() { 6 | $scope.show_badges = ! $scope.show_badges; 7 | $scope.show_hide_label = ($scope.show_badges) ? 'Hide': 'Show'; 8 | } 9 | }); -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/usermap/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/usermap/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/usermap/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/usermap/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/django_ecommerce/usermap/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/usermap/models.py: -------------------------------------------------------------------------------- 1 | from mongoengine.document import Document 2 | from mongoengine.fields import EmailField, StringField, \ 3 | PointField, SequenceField 4 | 5 | 6 | class UserLocation(Document): 7 | email = EmailField(required=True, unique=True, max_length=200) 8 | name = StringField(required=True, max_length=200) 9 | location = PointField(required=True) 10 | mappoint_id = SequenceField(required=True) 11 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/usermap/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/usermap/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | 4 | urlpatterns = patterns( 5 | 'usermap.json_views', 6 | url(r'^user_locations$', 'user_locations_list'), 7 | ) 8 | -------------------------------------------------------------------------------- /_chapters/chp17/django_ecommerce/usermap/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | 3 | 4 | def usermap(request): 5 | return render_to_response('usermap/usermap.html') 6 | -------------------------------------------------------------------------------- /_chapters/chp17/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | Pillow==2.7.0 3 | django-admin-bootstrapped==2.3.4 4 | django-embed-video==0.11 5 | django-rest-framework-mongoengine==1.5.4 6 | djangorestframework==2.4.2 7 | mock==1.0.1 8 | mongoengine==0.8.7 9 | psycopg2==2.5.3 10 | pymongo==2.7.2 11 | requests==2.3.0 12 | stripe==1.9.2 13 | -------------------------------------------------------------------------------- /_chapters/chp17/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/tests/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/tests/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp17/tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp17/tests/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/contact/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/contact/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/django_ecommerce/guitest_settings.py: -------------------------------------------------------------------------------- 1 | # Django settings for running gui tests with django_ecommerce project. 2 | from .settings import * 3 | 4 | DATABASES = { 5 | 'default': { 6 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', 7 | 'NAME': 'test_django_db', 8 | 'USER': 'djangousr', 9 | 'PASSWORD': 'djangousr', 10 | 'HOST': 'localhost', 11 | 'PORT': '5432', 12 | } 13 | } 14 | 15 | SERVER_ADDR = "127.0.0.1:9001" 16 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/djangular_polls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/djangular_polls/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/djangular_polls/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/djangular_polls/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/djangular_polls/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/djangular_polls/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/main/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/main/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/media/announce/main-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/media/announce/main-logo.png -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/media/images/fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/media/images/fig.png -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/payments/migrations/0009_merge.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import models, migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('payments', '0007_auto_20150606_0307'), 11 | ('payments', '0008_auto_20150311_1313'), 12 | ] 13 | 14 | operations = [ 15 | ] 16 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/payments/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/payments/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/payments/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from .json_views import ChangePassword 3 | 4 | 5 | urlpatterns = patterns( 6 | 'payments.json_views', 7 | url(r'^users$', 'post_user'), 8 | url(r'^users/password/(?P[0-9]+)$', ChangePassword.as_view(), 9 | name='change_password'), 10 | ) 11 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | Pillow==2.7.0 3 | django-admin-bootstrapped==2.3.4 4 | django-embed-video==0.11 5 | django-rest-framework-mongoengine==1.5.4 6 | djangorestframework==2.4.2 7 | mock==1.0.1 8 | mongoengine==0.8.7 9 | psycopg2==2.5.3 10 | pymongo==2.7.2 11 | requests==2.3.0 12 | selenium==2.45.0 13 | stripe==1.9.2 14 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/static/js/loggedInCtrl.js: -------------------------------------------------------------------------------- 1 | mecApp.controller('LoggedInCtrl', function($scope) { 2 | $scope.show_badges = false ; 3 | $scope.show_hide_label = "Show"; 4 | 5 | $scope.show = function() { 6 | $scope.show_badges = ! $scope.show_badges; 7 | $scope.show_hide_label = ($scope.show_badges) ? 'Hide': 'Show'; 8 | } 9 | }); -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/usermap/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/usermap/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/usermap/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/usermap/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/django_ecommerce/usermap/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/usermap/models.py: -------------------------------------------------------------------------------- 1 | from mongoengine.document import Document 2 | from mongoengine.fields import EmailField, StringField, \ 3 | PointField, SequenceField 4 | 5 | 6 | class UserLocation(Document): 7 | email = EmailField(required=True, unique=True, max_length=200) 8 | name = StringField(required=True, max_length=200) 9 | location = PointField(required=True) 10 | mappoint_id = SequenceField(required=True) 11 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/usermap/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/usermap/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | 4 | urlpatterns = patterns( 5 | 'usermap.json_views', 6 | url(r'^user_locations$', 'user_locations_list'), 7 | ) 8 | -------------------------------------------------------------------------------- /_chapters/chp18/django_ecommerce/usermap/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | 3 | 4 | def usermap(request): 5 | return render_to_response('usermap/usermap.html') 6 | -------------------------------------------------------------------------------- /_chapters/chp18/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | Pillow==2.7.0 3 | django-admin-bootstrapped==2.3.4 4 | django-embed-video==0.11 5 | django-rest-framework-mongoengine==1.5.4 6 | djangorestframework==2.4.2 7 | mock==1.0.1 8 | mongoengine==0.8.7 9 | psycopg2==2.5.3 10 | pymongo==2.7.2 11 | requests==2.3.0 12 | stripe==1.9.2 13 | -------------------------------------------------------------------------------- /_chapters/chp18/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/tests/gui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/tests/gui/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/tests/gui/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/tests/gui/pages/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/tests/unit/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/tests/unit/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/tests/unit/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/tests/unit/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/tests/unit/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp18/tests/unit/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp18/tests/unit/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/deploy/supervisor/mec.conf: -------------------------------------------------------------------------------- 1 | [program: mec] 2 | directory = /opt/mec_env/mec_app 3 | user = www-data 4 | command = /opt/mec_env/mec_app/deploy/gunicorn_start 5 | stdout_logfile = /opt/mec_env/log/supervisor-logfile.log 6 | stderr_logfile = /opt/mec_env/log/supervisor-error-logfile.log -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm, ContactFormAdmin) 10 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | 6 | class ContactView(ModelForm): 7 | message = forms.CharField(widget=forms.Textarea) 8 | 9 | class Meta: 10 | fields = ['name', 'email', 'topic', 'message'] 11 | model = ContactForm 12 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/contact/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/contact/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/django_ecommerce/guitest_settings.py: -------------------------------------------------------------------------------- 1 | # Django settings for running gui tests with django_ecommerce project. 2 | from .settings import * 3 | 4 | DATABASES = { 5 | 'default': { 6 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', 7 | 'NAME': 'test_django_db', 8 | 'USER': 'djangousr', 9 | 'PASSWORD': 'djangousr', 10 | 'HOST': 'localhost', 11 | 'PORT': '5432', 12 | } 13 | } 14 | 15 | SERVER_ADDR = "127.0.0.1:9001" 16 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/djangular_polls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/djangular_polls/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/djangular_polls/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/djangular_polls/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/djangular_polls/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/djangular_polls/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/main/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/main/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | 4 | class IsOwnerOrReadOnly(permissions.BasePermission): 5 | 6 | def has_object_permission(self, request, view, obj): 7 | 8 | #Allow all read type requests 9 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 10 | return True 11 | 12 | #this leaves us with write requests (i.e. POST / PUT / DELETE) 13 | return obj.user == request.user 14 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.inclusion_tag( 6 | 'main/templatetags/circle_item.html', 7 | takes_context=True 8 | ) 9 | def marketing__circle_item(context): 10 | return context 11 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/media/announce/main-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/media/announce/main-logo.png -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/media/images/fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/media/images/fig.png -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/payments/migrations/0009_merge.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import models, migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('payments', '0007_auto_20150606_0307'), 11 | ('payments', '0008_auto_20150311_1313'), 12 | ] 13 | 14 | operations = [ 15 | ] 16 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/payments/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/payments/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/payments/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from .json_views import ChangePassword 3 | 4 | 5 | urlpatterns = patterns( 6 | 'payments.json_views', 7 | url(r'^users$', 'post_user'), 8 | url(r'^users/password/(?P[0-9]+)$', ChangePassword.as_view(), 9 | name='change_password'), 10 | ) 11 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7 2 | Pillow==2.7.0 3 | django-admin-bootstrapped==2.3.4 4 | django-embed-video==0.11 5 | django-rest-framework-mongoengine==1.5.4 6 | djangorestframework==2.4.2 7 | mock==1.0.1 8 | mongoengine==0.8.7 9 | psycopg2==2.5.3 10 | pymongo==2.7.2 11 | requests==2.3.0 12 | selenium==2.45.0 13 | stripe==1.9.2 14 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/static/js/loggedInCtrl.js: -------------------------------------------------------------------------------- 1 | mecApp.controller('LoggedInCtrl', function($scope) { 2 | $scope.show_badges = false ; 3 | $scope.show_hide_label = "Show"; 4 | 5 | $scope.show = function() { 6 | $scope.show_badges = ! $scope.show_badges; 7 | $scope.show_hide_label = ($scope.show_badges) ? 'Hide': 'Show'; 8 | } 9 | }); -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends "__base.html" %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 6 |

{{ m.heading }}

7 |

{{ m.caption }}

8 |

{{ m.button_title }} »

9 |
10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/test.db -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/usermap/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/usermap/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/usermap/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/usermap/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/django_ecommerce/usermap/migrations/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/usermap/models.py: -------------------------------------------------------------------------------- 1 | from mongoengine.document import Document 2 | from mongoengine.fields import EmailField, StringField, \ 3 | PointField, SequenceField 4 | 5 | 6 | class UserLocation(Document): 7 | email = EmailField(required=True, unique=True, max_length=200) 8 | name = StringField(required=True, max_length=200) 9 | location = PointField(required=True) 10 | mappoint_id = SequenceField(required=True) 11 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/usermap/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/usermap/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | 4 | urlpatterns = patterns( 5 | 'usermap.json_views', 6 | url(r'^user_locations$', 'user_locations_list'), 7 | ) 8 | -------------------------------------------------------------------------------- /_chapters/chp19/django_ecommerce/usermap/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | 3 | 4 | def usermap(request): 5 | return render_to_response('usermap/usermap.html') 6 | -------------------------------------------------------------------------------- /_chapters/chp19/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/tests/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/tests/gui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/tests/gui/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/tests/gui/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/tests/gui/pages/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/tests/unit/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/tests/unit/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/tests/unit/contact/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/tests/unit/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/tests/unit/main/__init__.py -------------------------------------------------------------------------------- /_chapters/chp19/tests/unit/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/_chapters/chp19/tests/unit/payments/__init__.py -------------------------------------------------------------------------------- /django_ecommerce/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/contact/__init__.py -------------------------------------------------------------------------------- /django_ecommerce/contact/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactForm 3 | 4 | 5 | class ContactFormAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = ContactForm 8 | 9 | admin.site.register(ContactForm,ContactFormAdmin) -------------------------------------------------------------------------------- /django_ecommerce/contact/forms.py: -------------------------------------------------------------------------------- 1 | from django.forms import ModelForm 2 | from .models import ContactForm 3 | from django import forms 4 | 5 | class ContactView(ModelForm): 6 | message = forms.CharField(widget=forms.Textarea) 7 | 8 | class Meta: 9 | fields = ['name','email','topic','message'] 10 | model = ContactForm 11 | -------------------------------------------------------------------------------- /django_ecommerce/django_ecommerce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/django_ecommerce/__init__.py -------------------------------------------------------------------------------- /django_ecommerce/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/main/__init__.py -------------------------------------------------------------------------------- /django_ecommerce/main/permissions.py: -------------------------------------------------------------------------------- 1 | from rest_framework import permissions 2 | 3 | class IsOwnerOrReadOnly(permissions.BasePermission): 4 | 5 | def has_object_permissions(self, request, view, obj): 6 | 7 | #Allow all read type requests 8 | if request.method in ('GET', 'HEAD', 'OPTIONS'): 9 | return True 10 | 11 | #this leaves us with write requests (i.e. POST / PUT) 12 | return obj.user == request.user 13 | -------------------------------------------------------------------------------- /django_ecommerce/main/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/main/templatetags/__init__.py -------------------------------------------------------------------------------- /django_ecommerce/main/templatetags/main_marketing.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | @register.inclusion_tag('main/templatetags/circle_item.html', 5 | takes_context=True) 6 | def marketing__circle_item(context): 7 | return context 8 | -------------------------------------------------------------------------------- /django_ecommerce/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ecommerce.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /django_ecommerce/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/payments/__init__.py -------------------------------------------------------------------------------- /django_ecommerce/payments/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from payments.models import User 3 | 4 | 5 | class UserAdmin(admin.ModelAdmin): 6 | class Meta: 7 | model = User 8 | 9 | admin.site.register(User,UserAdmin) 10 | -------------------------------------------------------------------------------- /django_ecommerce/static/fonts/Starjedi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/fonts/Starjedi.eot -------------------------------------------------------------------------------- /django_ecommerce/static/fonts/Starjedi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/fonts/Starjedi.ttf -------------------------------------------------------------------------------- /django_ecommerce/static/fonts/Starjedi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/fonts/Starjedi.woff -------------------------------------------------------------------------------- /django_ecommerce/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /django_ecommerce/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /django_ecommerce/static/img/badge_force.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/badge_force.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/badge_jedi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/badge_jedi.png -------------------------------------------------------------------------------- /django_ecommerce/static/img/badge_padwan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/badge_padwan.png -------------------------------------------------------------------------------- /django_ecommerce/static/img/badge_trooper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/badge_trooper.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/badge_vader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/badge_vader.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/beat_jarjar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/beat_jarjar.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/clone_army.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/clone_army.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/darth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/darth.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/leia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/leia.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/star-wars-battle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/star-wars-battle.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/star-wars-cast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/star-wars-cast.jpg -------------------------------------------------------------------------------- /django_ecommerce/static/img/yoda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/django_ecommerce/static/img/yoda.jpg -------------------------------------------------------------------------------- /django_ecommerce/templates/flatpages/default.html: -------------------------------------------------------------------------------- 1 | {% extends '__base.html' %} 2 | 3 | {% block content %} 4 | {{ flatpage.content }} 5 | {% endblock %} 6 | -------------------------------------------------------------------------------- /django_ecommerce/templates/main/templatetags/circle_item.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | {% for m in marketing_items %} 4 |
5 | {{ m.img }} 7 |

{{ m.heading }}

8 |

{{ m.caption }}

9 |

{{ m.button_title }} »

11 |
12 | {% endfor %} 13 | -------------------------------------------------------------------------------- /django_ecommerce/templates/payments/_field.html: -------------------------------------------------------------------------------- 1 |
2 | {{ field.label_tag }} 3 |
4 | {{ field }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /repo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/repo.zip -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django 2 | mock 3 | requests 4 | stripe 5 | psycopg2 6 | djangorestframework 7 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/tests/__init__.py -------------------------------------------------------------------------------- /tests/contact/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/tests/contact/__init__.py -------------------------------------------------------------------------------- /tests/main/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/tests/main/__init__.py -------------------------------------------------------------------------------- /tests/payments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realpython/book3-exercises/db0a0f7a51075ed7edf1914296f35acf2376baaa/tests/payments/__init__.py --------------------------------------------------------------------------------