geonaut / Django-By-Example-Textbook

The apps constructed following the Django by Example textbook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django site built following the Django by Example text book, by Antonio Melé

Chapter One

This chapter takes the reader from a zero to a Django quick-start app. It includes setting up a virtual environment and then using the built-in startapp function. A basic post model is created, and then the database migrated. A superuser is created, allowing the user to login to the Django admin interface. Next the Django ORM is introduced, and a basic queryset is manipulated. The basic blog is finished off with an index template, some pagination and an alternative class-based view.

Chapter Two

Using the blog from Chatper 1, some additional features are added, such as a comment system and email forwarding functionality. I didn't find it necessary to actually setup the SMTP connection for email sending. A tagging system is also setup using django-taggit, which is extended to a 'similar posts' section at the bottom of blog posts. The chapter ends with a reasonably well-featured blog.

Chapter Three

This chapter starts off by setting up some custom tempalate tags, such as total post count, most recent posts and most commented posts, based on the Django helper functions, such as simple_tag and inclusion_tag. The next part is to create a custom template filter, and the book chooses markdown, so you are able to write markdown in a blog post and have it rendered properly. After that some supporting website features, such as an xml sitemap and an RSS feed are setup. This is nice, as it gently introduces the reader to machine readable interfaces. The final part of this chapter is quite involved, and requires the installation of Java and Haystack. It produces an asynchronously generated index, which speeds up search. This requires Solr to be runnning, and the schema needs to be manually generated. Personally, I don't think this is really necessary at this stage, and introducing Java might be daunting to the novice.

Chapter Four

Chapter 4 makes extensive use of the Django authentication and login module, profile model and associated forms such as UserRegistration form. These are pretty well-developed modules, so mostly this is an exercise in routing between screens, and setting up a user dashboard. The exercise then moves on to moving the messaging module, to setup some overlay notifications, and finally, to OAuth registrations, using Facebook, Twitter and Google. These last require API keys and developer accounts, as well as dummy accounts for registration, so I didn't bother to connect to the APIs.

About

The apps constructed following the Django by Example textbook


Languages

Language:Python 96.8%Language:JavaScript 1.6%Language:HTML 0.9%Language:CSS 0.8%Language:Shell 0.0%