Loading…

Web Development with Django Cookbook - Second Edition.

Over 70 practical recipes to help you create scalable websites using the Django 1.8 frameworkAbout This Book This is the latest book on the market that will help you take advantage of the new features added to Django 1.8 This book consists of recipes of varying complexities to help you create multil...

Full description

Bibliographic Details
Call Number:Libro Electrónico
Main Author: Bendoraitis, Aidas (Author)
Format: Electronic eBook
Language:Inglés
Published: Birmingham : Packt Publishing, Limited Jan. 2016.
Edition:2nd ed.
Subjects:
Online Access:Texto completo
Table of Contents:
  • Cover
  • Copyright
  • Credits
  • About the Author
  • About the Reviewers
  • www.PacktPub.com
  • Table of Contents
  • Preface
  • Chapter 1: Getting Started with Django 1.8
  • Introduction
  • Working with a virtual environment
  • Creating a project file structure
  • Handling project dependencies with pip
  • Making your code compatible with both Python 2.7 and Python 3
  • Including external dependencies in your project
  • Configuring settings for development, testing, staging, and production
  • environments
  • Defining relative paths in the settings
  • Creating and including local settings
  • Setting up STATIC_URL dynamically for Subversion users
  • Setting up STATIC_URL dynamically for Git users
  • Setting UTF-8 as the default encoding for MySQL configuration
  • Setting the Subversion ignore property
  • Creating the Git ignore file
  • Deleting Python-compiled files
  • Respecting the import order in Python files
  • Creating app configuration
  • Defining overwritable app settings
  • Chapter 2: Database Structure
  • Introduction
  • Using model mixins
  • Creating a model mixin with URL-related methods
  • Creating a model mixin to handle creation and modification dates
  • Creating a model mixin to take care of meta tags
  • Creating a model mixin to handle generic relations
  • Handling multilingual fields
  • Using migrations
  • Switching from South migrations to Django migrations
  • Changing a foreign key to the many-to-many field
  • Chapter 3: Forms and Views
  • Introduction
  • Passing HttpRequest to the form
  • Utilizing the save method of the form
  • Uploading images
  • Creating a form layout with django-crispy-forms
  • Downloading authorized files
  • Filtering object lists
  • Managing paginated lists
  • Composing class-based views
  • Generating PDF documents
  • Implementing a multilingual search with Haystack
  • Chapter 4: Templates and JavaScript.
  • Introduction
  • Arranging the base.html template
  • Including JavaScript settings
  • Using HTML5 data attributes
  • Opening object details in a modal dialog
  • Implementing a continuous scroll
  • Implementing the Like widget
  • Uploading images by Ajax
  • Chapter 5: Custom Template Filters and Tags
  • Introduction
  • Following conventions for your own template filters and tags
  • Creating a template filter to show how many days have passed since a post was
  • published
  • Creating a template filter to extract the first media object
  • Creating a template filter to humanize URLs
  • Creating a template tag to include a template if it exists
  • Creating a template tag to load a QuerySet in a template
  • Creating a template tag to parse content as a template
  • Creating a template tag to modify request query parameters
  • Chapter 6: Model Administration
  • Introduction
  • Customizing columns on the change list page
  • Creating admin actions
  • Developing change list filters
  • Customizing default admin settings
  • Inserting a map into a change form
  • Chapter 7: Django CMS
  • Introduction
  • Creating templates for Django CMS
  • Structuring the page menu
  • Converting an app to a CMS app
  • Attaching your own navigation
  • Writing your own CMS plugin
  • Adding new fields to the CMS page
  • Chapter 8: Hierarchical Structures
  • Introduction
  • Creating hierarchical categories
  • Creating a category administration interface with django-mptt-admin
  • Creating a category administration interface with django-mptt-tree-editor
  • Rendering categories in a template
  • Using a single selection field to choose a category in forms
  • Using a checkbox list to choose multiple categories in forms
  • Chapter 9: Data Import and Export
  • Introduction
  • Importing data from a local CSV file
  • Importing data from a local Excel file.
  • Importing data from an external JSON file
  • Importing data from an external XML file
  • Creating filterable RSS feeds
  • Using Tastypie to create API
  • Using Django REST framework to create API
  • Chapter 10: Bells and Whistles
  • Introduction
  • Using the Django shell
  • Using database query expressions
  • Monkey-patching the slugify() function for better internationalization support
  • Toggling the Debug Toolbar
  • Using ThreadLocalMiddleware
  • Caching the method return value
  • Using Memcached to cache Django views
  • Using signals to notify administrators about new entries
  • Checking for missing settings
  • Chapter 11: Testing and Deployment
  • Introduction
  • Testing pages with Selenium
  • Testing views with mock
  • Testing API created using Django REST framework
  • Releasing a reusable Django app
  • Getting detailed error reporting via e-mail
  • Deploying on Apache with mod_wsgi
  • Setting up cron jobs for regular tasks
  • Creating and using the Fabric deployment script
  • Index.