you've done the django tutorial, what next?
DESCRIPTION
Some suggestions on where to look next when building that next Django siteTRANSCRIPT
![Page 1: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/1.jpg)
You’ve done the Django tutorial.What next?
Andy McKayClearwind Consulting
@clearwind
![Page 2: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/2.jpg)
build something
![Page 3: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/3.jpg)
my opinions, likely wrong
![Page 4: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/4.jpg)
1. Setting up2. Writing models3. Middle years4. Avoid5. Tools
![Page 5: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/5.jpg)
Part I: Setting up
![Page 6: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/6.jpg)
app vs project vs...
![Page 7: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/7.jpg)
past caring
![Page 8: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/8.jpg)
app directory
![Page 9: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/9.jpg)
(a). base templates
![Page 10: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/10.jpg)
(b). context processorhttp://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-
context-processors
![Page 11: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/11.jpg)
def context(request): data = {} return data
![Page 12: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/12.jpg)
(c). render shortcutseg: http://www.djangosnippets.org/snippets/1022/
![Page 13: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/13.jpg)
(d). site constants
![Page 14: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/14.jpg)
(e) your middlewarehttp://docs.djangoproject.com/en/1.1/topics/http/middleware/#writing-your-
own-middleware
![Page 15: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/15.jpg)
(f) your auth. backendhttp://docs.djangoproject.com/en/dev/topics/auth/#topics-auth
![Page 16: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/16.jpg)
(g) base classes
![Page 17: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/17.jpg)
model base class
![Page 18: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/18.jpg)
class Base(models.Model): class Meta: abstract = True
![Page 19: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/19.jpg)
form base class
![Page 20: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/20.jpg)
class Form(forms.Form):! pass
class ModelForm(forms.ModelForm):! pass
![Page 21: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/21.jpg)
Part 2: Writing models
![Page 22: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/22.jpg)
(a) fixtures
![Page 23: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/23.jpg)
not just for testing
![Page 24: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/24.jpg)
create data in admin
![Page 25: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/25.jpg)
manage.py dumpdata
![Page 26: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/26.jpg)
(b) migration
![Page 27: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/27.jpg)
during development
![Page 28: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/28.jpg)
reset scripthttp://www.agmweb.ca/blog/andy/2154/
![Page 29: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/29.jpg)
drop db, create db, syncdb, load fixtures, start up server etc...
![Page 30: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/30.jpg)
my workflow
![Page 31: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/31.jpg)
1. create app within project2. define models3. access admin4. smoke test models5. alter, run “reset”6. access admin (back to 4 until happy)7. enter sample data8. dump data to fixtures9. add fixture loading to “reset”10. continue... write tests and retail view
![Page 32: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/32.jpg)
at some point... beta?
![Page 34: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/34.jpg)
Part 3: The middle years
![Page 35: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/35.jpg)
(a) signals
![Page 36: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/36.jpg)
great for decouplinghttp://docs.djangoproject.com/en/dev/ref/signals/
#ref-signals
![Page 37: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/37.jpg)
signals.pre_save.connect(! add_profile, ! sender=User)
![Page 38: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/38.jpg)
custom signalshttp://docs.djangoproject.com/en/dev/topics/signals/#defining-and-sending-
signals
![Page 39: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/39.jpg)
(b) URLs
![Page 40: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/40.jpg)
always use named urlshttp://docs.djangoproject.com/en/dev/topics/http/urls/#url
![Page 41: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/41.jpg)
urlpatterns = patterns('', url(r'^index/$', index_view, name="main-view"), ...)
![Page 42: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/42.jpg)
reverse(“main-view”)
![Page 43: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/43.jpg)
{% url main-view %}
![Page 44: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/44.jpg)
(c) class based viewshttp://www.slideshare.net/simon/
classbased-views-with-django
![Page 45: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/45.jpg)
def boring(request): ... return some_html
![Page 46: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/46.jpg)
class boring: def get(request): ... return some_html
![Page 47: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/47.jpg)
Part 4: Avoid these
![Page 48: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/48.jpg)
generic viewshttp://docs.djangoproject.com/en/dev/ref/generic-views/
![Page 49: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/49.jpg)
push logic into urls,always need rewriting
![Page 50: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/50.jpg)
custom template tags(maybe)
![Page 51: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/51.jpg)
complicated templates
![Page 52: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/52.jpg)
{% div %} {% dl %} {% dt %}Name{% enddt %} {% dd %}Definition{% enddd %} {% enddl %}{% enddiv %}
![Page 53: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/53.jpg)
some of django.contrib...
![Page 54: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/54.jpg)
comments
![Page 55: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/55.jpg)
Part 5: Debug Tools
![Page 56: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/56.jpg)
pdbhttp://docs.python.org/library/pdb.html
![Page 57: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/57.jpg)
pdbhttp://docs.python.org/library/pdb.html
(not optional)
![Page 60: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/60.jpg)
django debug toolbarhttp://github.com/robhudson/django-debug-toolbar
![Page 61: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/61.jpg)
command extensionshttp://code.google.com/p/django-command-extensions/
![Page 62: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/62.jpg)
![Page 63: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/63.jpg)
![Page 64: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/64.jpg)
![Page 65: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/65.jpg)
![Page 67: You've done the Django Tutorial, what next?](https://reader034.vdocuments.site/reader034/viewer/2022042714/555a2f03d8b42a900d8b4e92/html5/thumbnails/67.jpg)
Fin. Questions?
Andy McKayClearwind Consulting
@clearwind