This repository contains the code used in my DjangoCon 2013 presentation. All other materials may be accessed here.
NB: To ease setup of this demonstration, the Django Secret Key has not been removed from the settings.py
file. This site should therefore never be used for production purposes.
$ git clone https://github.com/jambonrose/djangocon2013-otwcbv.git djotwcbv
$ cd djotwcbv
$ ./manage.py syncdb
$ ./manage.py runserver 7777
Navigate your preferred browser to 127.0.0.1:7777
.
To make navigating the code easier, the project provides several tags. Each tag corresponds to a specific moment in the presentation/article.
Any of the tags may be accessed with: git checkout tagname
. For example: git checkout cbgv-url-only
.
In order of appearance:
function-views
- The site uses functions to process requests.
cbv
- The site uses class-based views to process requests.
cbgv-basic
- The site uses class-based generic views (in
bank/views.py
) to process requests, removing the necessity forbank/forms.py
.
- The site uses class-based generic views (in
cbgv-url-only
- The site uses class-based generic views in the URL mapping (
bank/urls.py
) to process requests, removing the necessity forbank/views.py
(bank/forms.py
still unnecessary).
- The site uses class-based generic views in the URL mapping (
cbgv-customized
- The site achieves the goals set forth in the presentation/article by customizing class-based generic views in
bank/views.py
and overridingModelForm
functionality inbank/forms.py
. This last tag is equivalent to head ofmaster
.
- The site achieves the goals set forth in the presentation/article by customizing class-based generic views in