ebook img

Django Unleashed PDF

2379 Pages·2015·58.59 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Django Unleashed

About This E-Book EPUB is an open, industry-standard format for e-books. However, support for EPUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturer’s Web site. Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the e-book in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a “Click here to view code image” link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app. Django Unleashed Andrew Pinkham 800 East 96th Street, Indianapolis, Indiana 46240 USA Django Unleashed Copyright © 2016 by Pearson Education, Inc. All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein. ISBN-13: 978-0-321-98507-1 ISBN-10: 0-321-98507-9 The Library of Congress cataloging-in-publication data is available at http://lccn.loc.gov/2015033839. Printed in the United States of America First printing, October 2015 Editor-in-Chief Mark L. Taub Acquisitions Editor Debra Williams Cauley Development Editor Chris Zahn Managing Editor John Fuller Project Editor Elizabeth Ryan Copy Editor Carol Lallier Indexer John S. Lewis Proofreader Linda Begley Editorial Assistant Kim Boedigheimer Cover Designer Mark Shirar Compositor DiacriTech Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark. Warning and Disclaimer Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an “as is” basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or programs accompanying it. Special Sales For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at [email protected] or (800) 382-3419. For government sales inquiries, please contact [email protected]. For questions about sales outside the U.S., please contact [email protected]. Contents Preface Acknowledgments About the Author I Django’s Core Features 1 Starting a New Django Project: Building a Startup Categorizer with Blog 1.1 Introduction 1.2 Website Basics 1.3 Understanding Modern Websites 1.4 Building Modern Websites: The Problems That Frameworks Solve and Their Caveats 1.5 Django: Python Web Framework 1.6 Defining the Project in Part I 1.7 Creating a New Django Project and Django Apps 1.8 Putting It All Together 2 Hello World: Building a Basic Webpage in Django 2.1 Introduction 2.2 Creating and Integrating a New App 2.3 Building Hello World 2.4 Displaying Hello World 2.5 Controller Limitations: The Advantages of Models and Views 2.6 Removing Our Helloworld App from Our Project 2.7 Putting It All Together 3 Programming Django Models and Creating a SQLite Database 3.1 Introduction 3.2 Why Use a Database? 3.3 Organizing Our Data 3.4 Specifying and Organizing Data in Django Using Models 3.5 Using Django to Automatically Create a SQLite Database with manage.py 3.6 Manipulating Data in the Database: Managers and QuerySets 3.7 String Case Ordering 3.8 Putting It All Together 4 Rapidly Producing Flexible HTML with Django Templates 4.1 Introduction 4.2 Revisiting Hello World: The Advantages of Templates 4.3 Understanding Django Templates and Their Goals 4.4 Choosing a Format, an Engine, and a Location for Templates 4.5 Building a First Template: A Single Tag Object 4.6 Building the Rest of Our App Templates 4.7 Using Template Inheritance for Design Consistency 4.8 Using Templates in Python with the Template, Context, and loader Classes 4.9 Putting It All Together 5 Creating Webpages with Controllers in Django: Views and URL Configurations 5.1 Introduction 5.2 The Purpose of Views and URL Configurations 5.3 Step-by-Step Examination of Django’s Use of Views and URL Configurations 5.4 Building Tag Detail Webpage 5.5 Generating 404 Errors for Invalid Queries 5.6 Shortening the Development Process with Django View Shortcuts 5.7 URL Configuration Internals: Adhering to App Encapsulation 5.8 Implementing the Views and URL Configurations to the Rest of the Site 5.9 Class-Based Views 5.10 Redirecting the Homepage

Description:
Django is an amazingly powerful system for creating modern, dynamic websites. But programming Django hasn’t always been easy–until now. Django Unleashed is your step-by-step, beginner-friendly guide to leveraging Django’s core capabilities and its powerful contributed library. You’ll learn i
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.