Chapter . Introduction

I have been working with the Django framework for about a year and a half, and I love it. Every so often you run into ideas that make absolute, complete sense, and Django is one of those. The folks at Django seem to be bent on making it the most elegant web framework available, and so far they are doing a great job.

This was a tough book to write. The Django framework is simple to implement, but you can accomplish so much with it. The format of this book is Teach Yourself in 24 Hours. The idea is that after spending 24 hours with this book and a Django installation, you should have a pretty good idea of how to use Django to build a full-featured production website.

Throughout this book, I use a fictitious website project called iFriends to illustrate the building blocks of a Django-powered website. The book has several “Try It Yourself” sections that take you through specific tasks of building the iFriends website. Actually do the “Try It Yourself” sections. They will help everything else make a lot more sense. They build on each other, so if you skip one, future “Try It Yourself” sections may not work properly.

When you have finished the “Try It Yourself” sections, you will have a mostly functional website. You should easily have enough skills by then that you could tweak and finish the website on your own in only a few hours if you wanted to. There just wasn’t enough room in the book to finish every component. I felt it was much more important to cover the topics that I did.

I do have one disclaimer: There is absolutely no CSS code in my HTML template examples. I would much rather have used CSS code to format my HTML templates than the classic HTML tags (some of them deprecated) that I used. I chose not to include CSS for two important reasons. The first reason is room. Adding CSS files to all the examples would have taken quite a bit more room, which I didn’t have. The second reason is that this book is designed for Python programmers as well as HTML programmers. Using CSS for someone who is not as familiar with it could provide a distraction. This book is about learning to implement the Django framework. CSS programming techniques belong in a different book.

When designing the content for this book, I tried to come up with the most relevant way to present the Django framework that will actually help programmers develop websites that are pertinent to real-world needs. I know that a few components and concepts have been left out. I welcome your comments and any suggestions on things that you feel need to be added to this book. If I get a chance, I will try to incorporate them into future revisions of the book. You can email any queries or suggestions to .

I hope you enjoy the Django framework as much as I have and that the concepts in this book prove useful to you.

Who Should Read This Book

This book should be read by anyone who is developing or even considering developing websites. The Django framework saves web developers a lot of time and headaches. This book is designed for website developers who have at least some familiarity with the Python programming language. Don’t worry if you are not very familiar with Python. You should be able to pick up on what is going on with a few visits to www.python.org.

How This Book Is Organized

This book is organized into four parts that help you quickly navigate the Django framework so that you will have the knowledge necessary to leverage the framework to build production websites. I tried to design the book to start slowly so that you will be able to build a good foundation for the Django framework. Then, as the hours (chapters) progress, the book delves deeper into different aspects of the Django framework.

  • Part I, “Creating the Website Framework,” covers the basics of installing, configuring, and using the Django framework to build basic websites. You are introduced to the model, template, and view concepts that Django uses to implement websites.

  • Part II, “Implementing the Website Interface,” covers building templates and views to build web pages. You will learn how to use templates and views to store, access, and retrieve data that is stored in the website’s database.

  • Part III, “Implementing a Full-Featured Website,” covers adding authentication, cookie handling, and other features necessary to implement a full production website. You will learn how to create users and groups and how to assign permissions to specific data.

  • Part IV, “Implementing Advanced Website Components,” covers some of the advanced features of the Django framework that you will likely want to implement in production websites. You will learn how to implement middleware to enable advanced request and response handlers. You will also learn how to implement localized strings to add multiple-language capability to the website, implement caching to improve website performance, and deploy a Django website.

How to Use This Book

The Teach Yourself in 24 Hours series has several unique elements that will help you as you are trying to learn the Django framework. Throughout the book, I use the following elements to draw attention to specific concepts:

Did you Know?

This element provides information about slightly off-topic tangents that may be beneficial to you but that are not necessarily directly related to the current section.

By the Way

This element provides information that is directly related to the current section but that does not necessarily flow with the text. It discusses what is happening in the background or points that you may not easily pick up on but that are important.

Watch Out!

This element notes important things that you need to know before proceeding through the book. It is important to read these sections to avoid problems with your website.

The “Try It Yourself” sections are designed to take you through the steps of actually performing the tasks that you have been reading about. Do not skip these sections. They usually provide additional information about the topic and are a great chance to practice the concepts.

At the end of each hour, you will find the following sections that are designed to help you solidify what you have read:

  • The “Q&A” section poses questions and gives answers on concepts that are related to the hour but that fall outside what is covered in the book.

  • The “Quiz” section provides questions and answers about the topics covered in each hour.

  • The “Exercises” section lists activities that you can do to practice what you have learned during the hour. These exercises are a great way to strike out on your own a bit and get more confident with Django.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.151.153