ORPP logo
Image from Google Jackets

Mastering Django : Core.

By: Material type: TextTextPublisher: Birmingham : Packt Publishing, Limited, 2016Copyright date: ©2016Edition: 1st edDescription: 1 online resource (672 pages)Content type:
  • text
Media type:
  • computer
Carrier type:
  • online resource
ISBN:
  • 9781787286344
Subject(s): Genre/Form: Additional physical formats: Print version:: Mastering Django: CoreDDC classification:
  • 6.7
LOC classification:
  • TK5105.8885.D54.G467 2016
Online resources:
Contents:
Cover -- Copyright -- Credits -- About the Author -- www.PacktPub.com -- Table of Contents -- Preface -- Chapter 1: Introduction to Django and Getting Started -- Introducing Django -- Django's history -- Installing Django -- Installing Python -- Python versions -- Installation -- Installing a Python Virtual Environment -- Installing Django -- Setting up a database -- Starting a project -- Django settings -- The development server -- The Model-View-Controller (MVC) design pattern -- What's next? -- Chapter 2: Views and URLconfs -- Your first Django-powered page: Hello World -- Your first view -- Your first URLconf -- Regular expressions -- A quick note about 404 errors -- A quick note about the site root -- How Django processes a request -- Your second view: dynamic content -- URLconfs and loose coupling -- Your third view: dynamic URLs -- Django's pretty error pages -- What's next? -- Chapter 3: Templates -- Template system basics -- Using the template system -- Creating template objects -- Rendering a template -- Dictionaries and contexts -- Multiple contexts, same template -- Context variable lookup -- Method call behavior -- How invalid variables are handled -- Basic template-tags and filters -- Tags -- if/else -- for -- ifequal/ifnotequal -- Comments -- Filters -- Philosophies and limitations -- Using templates in views -- Template loading -- Template directories -- render() -- Template subdirectories -- The include template tag -- Template inheritance -- What's next? -- Chapter 4: Models -- The "dumb" way to do database queries in views -- Configuring the database -- Your first app -- Defining Models in Python -- Your first model -- Installing the Model -- Basic data access -- Adding model string representations -- Inserting and updating data -- Selecting objects -- Filtering data -- Retrieving single objects -- Ordering data.
Chaining lookups -- Slicing data -- Updating multiple objects in one statement -- Deleting objects -- What's next? -- Chapter 5: The Django Admin Site -- Using the admin site -- Start the development server -- Enter the admin site -- Adding your models to the admin site -- Making fields optional -- Making date and numeric fields optional -- Customizing field labels -- Custom model admin classes -- Customizing change lists -- Customizing edit forms -- Users, groups, and permissions -- When and why to use the admin interface-and when not to -- What's next? -- Chapter 6: Forms -- Getting data from the Request Object -- Information about the URL -- Other information about the Request -- Information about submitted data -- A simple form-handling example -- Query string parameters -- Improving our simple form-handling example -- Simple validation -- Making a contact form -- Your first form class -- Tying form objects into views -- Changing how fields are rendered -- Setting a maximum length -- Setting initial values -- Custom validation rules -- Specifying labels -- Customizing form design -- What's next? -- Chapter 7: Advanced Views and URLconfs -- URLconf Tips and Tricks -- Streamlining function imports -- Special-Casing URLs in debug mode -- Named groupsPreview -- The matching/grouping algorithm -- What the URLconf searches against -- Captured arguments are always strings -- Specifying defaults for view arguments -- Performance -- Error handling -- Including other URLconfs -- Captured parameters -- Passing extra options to view functions -- Passing extra options to include() -- Reverse resolution of URLs -- Examples -- Naming URL patterns -- URL namespaces -- Reversing namespaced URLs -- URL namespaces and included URLconfs -- What's next? -- Chapter 8: Advanced Templates -- Template language review -- Requestcontext and context processors -- auth.
DEBUG -- i18n -- MEDIA -- static -- csrf -- Request -- messages -- Guidelines for writing our own context processors -- Automatic HTML escaping -- How to turn it off -- For individual variables -- For template blocks -- Automatic escaping of string literals in filter arguments -- Inside Template loading -- The DIRS option -- Loader types -- Filesystem loader -- App directories loader -- Other loaders -- Extending the template system -- Code layout -- Creating a template library -- Custom template tags and filters -- Writing custom template filters -- Registering custom filters -- Template filters that expect strings -- Filters and auto-escaping -- Filters and time zones -- Writing custom template tags -- Simple tags -- Inclusion tags -- Assignment tags -- Advanced custom template tags -- A quick overview -- Writing the compilation function -- Writing the renderer -- Auto-escaping Considerations -- Thread-safety Considerations -- Registering the tag -- Passing template variables to The Tag -- Setting a variable in the context -- Variable scope in context -- Parsing until another block tag -- Parsing until another block tag, and saving contents -- What's next -- Chapter 9: Advanced Models -- Related objects -- Accessing ForeignKey values -- Accessing many-to-many values -- Managers -- Adding extra manager methods -- Modifying initial manager QuerySets -- Model methods -- Overriding predefined model methods -- Executing raw SQL queries -- Performing raw queries -- Model table names -- Mapping query fields to model fields -- Index lookups -- Deferring model fields -- Adding annotations -- Passing parameters into raw() -- Executing custom SQL directly -- Connections and cursors -- Adding extra Manager methods -- What's next? -- Chapter 10: Generic Views -- Generic views of objects -- Making "friendly" template contexts -- Adding extra context.
Viewing subsets of objects -- Dynamic filtering -- Performing extra work -- What's next? -- Chapter 11: User Authentication in Django -- Overview -- Using the Django authentication system -- User objects -- Creating superusers -- Creating users -- Changing passwords -- Permissions and authorization -- Default permissions -- Groups -- Programmatically creating permissions -- Permission caching -- Authentication in web requests -- How to log a user in -- How to log a user out -- Limiting access to logged-in users -- The raw way -- The login_required decorator -- Limiting access to logged-in users that pass a test -- The permission_required() decorator -- Session invalidation on password change -- Authentication views -- Login -- Logout -- Logout_then_login -- Password_change -- Password_change_done -- Password_reset -- Password_reset_done -- Password_reset_confirm -- Password_reset_complete -- The redirect_to_login helper function -- Built-in forms -- Authenticating data in templates -- Users -- Permissions -- Managing users in the admin -- Creating users -- Changing passwords -- Password management in Django -- How Django stores passwords -- Using Bcrypt with Django -- Password truncation with BCryptPasswordHasher -- Other Bcrypt implementations -- Increasing the work factor -- Password upgrading -- Manually managing a user's password -- Customizing authentication in Django -- Other authentication sources -- Specifying authentication backends -- Writing an authentication backend -- Handling authorization in custom backends -- Authorization for anonymous users -- Authorization for inactive users -- Handling object permissions -- Custom permissions -- Extending the existing user model -- Substituting a custom user model -- What's next? -- Chapter 12: Testing in Django -- Introduction to testing -- Introducing automated testing.
What are automated tests? -- So why create tests? -- Basic testing strategies -- Writing a test -- Creating a test -- Running tests -- Testing tools -- The test client -- Provided TestCase classes -- Simple TestCase -- Transaction TestCase -- TestCase -- LiveServerTestCase -- Test cases features -- Default test client -- Fixture loading -- Overriding settings -- settings() -- modify_settings() -- override_settings() -- modify_settings() -- Assertions -- Email services -- Management commands -- Skipping tests -- The test database -- Using different testing frameworks -- What's next? -- Chapter 13: Deploying Django -- Preparing your codebase for production -- Deployment checklist -- Critical settings -- SECRET_KEY -- DEBUG -- Environment-specific settings -- ALLOWED_HOSTS -- CACHES -- DATABASES -- EMAIL_BACKEND and Related Settings -- STATIC_ROOT and STATIC_URL -- MEDIA_ROOT and MEDIA_URL -- HTTPS -- CSRF_COOKIE_SECURE -- SESSION_COOKIE_SECURE -- Performance optimizations -- CONN_MAX_AGE -- TEMPLATES -- Error reporting -- LOGGING -- ADMINS and MANAGERS -- Customize the default error views -- Using a virtualenv -- Using different settings for production -- Deploying Django to a production server -- Deploying Django with Apache and mod_wsgi -- Basic configuration -- Using mod_wsgi daemon Mode -- Serving files -- Serving the admin files -- If you get a UnicodEncodError -- Serving static files in production -- Serving the site and your static files from the same server -- Serving static files from a dedicated server -- Serving static files from a cloud service or CDN -- Scaling -- Running on a single server -- Separating out the database server -- Running a separate media server -- Implementing load balancing and redundancy -- Going big -- Performance tuning -- There's no such thing as Too Much RAM -- Turn off Keep-Alive -- Use Memcached.
Use Memcached often.
Summary: About This BookGain a complete understanding of Django-the most popular, Python-based web framework in the worldGain the skills to successfully designing, developing, and deploying your appThis book is packaged with fully described code so you can learn the fundamentals and the advanced topics to get a complete understanding of all of Django's core functionsWho This Book Is For This book assumes you have a basic understanding of the Internet and programming. Experience with Python or Django would be an advantage, but is not necessary. It is ideal for beginner to intermediate programmers looking for a fast, secure, scalable, and maintainable alternative web development platform to those based on PHP, Java, and dotNET. What You Will LearnUse Django to access user-submitted form data, validate it, and work with itGet to know advanced URLconf tips and tricksExtend Django's template system with custom codeDefine models and use the database API to create, retrieve, update, and delete recordsFully extend and customize the default implementation as per your project's needsTest and deploy your Django applicationGet to know more about Django's session, cache Framework, and middlewareIn Detail Mastering Django: Core is a completely revised and updated version of the original Django Book, written by Adrian Holovaty and Jacob Kaplan-Moss - the creators of Django. The main goal of this book is to make you a Django expert. By reading this book, you'll learn the skills needed to develop powerful websites quickly, with code that is clean and easy to maintain. This book is also a programmer's manual that provides complete coverage of the current Long Term Support (LTS) version of Django. For developers creating applications for commercial and business critical deployments, Mastering Django: Core provides a complete, up-to-date resource for Django 1.8LTS with aSummary: stable code-base, security fixes and support out to 2018.
Tags from this library: No tags from this library for this title. Log in to add tags.
Star ratings
    Average rating: 0.0 (0 votes)
No physical items for this record

Cover -- Copyright -- Credits -- About the Author -- www.PacktPub.com -- Table of Contents -- Preface -- Chapter 1: Introduction to Django and Getting Started -- Introducing Django -- Django's history -- Installing Django -- Installing Python -- Python versions -- Installation -- Installing a Python Virtual Environment -- Installing Django -- Setting up a database -- Starting a project -- Django settings -- The development server -- The Model-View-Controller (MVC) design pattern -- What's next? -- Chapter 2: Views and URLconfs -- Your first Django-powered page: Hello World -- Your first view -- Your first URLconf -- Regular expressions -- A quick note about 404 errors -- A quick note about the site root -- How Django processes a request -- Your second view: dynamic content -- URLconfs and loose coupling -- Your third view: dynamic URLs -- Django's pretty error pages -- What's next? -- Chapter 3: Templates -- Template system basics -- Using the template system -- Creating template objects -- Rendering a template -- Dictionaries and contexts -- Multiple contexts, same template -- Context variable lookup -- Method call behavior -- How invalid variables are handled -- Basic template-tags and filters -- Tags -- if/else -- for -- ifequal/ifnotequal -- Comments -- Filters -- Philosophies and limitations -- Using templates in views -- Template loading -- Template directories -- render() -- Template subdirectories -- The include template tag -- Template inheritance -- What's next? -- Chapter 4: Models -- The "dumb" way to do database queries in views -- Configuring the database -- Your first app -- Defining Models in Python -- Your first model -- Installing the Model -- Basic data access -- Adding model string representations -- Inserting and updating data -- Selecting objects -- Filtering data -- Retrieving single objects -- Ordering data.

Chaining lookups -- Slicing data -- Updating multiple objects in one statement -- Deleting objects -- What's next? -- Chapter 5: The Django Admin Site -- Using the admin site -- Start the development server -- Enter the admin site -- Adding your models to the admin site -- Making fields optional -- Making date and numeric fields optional -- Customizing field labels -- Custom model admin classes -- Customizing change lists -- Customizing edit forms -- Users, groups, and permissions -- When and why to use the admin interface-and when not to -- What's next? -- Chapter 6: Forms -- Getting data from the Request Object -- Information about the URL -- Other information about the Request -- Information about submitted data -- A simple form-handling example -- Query string parameters -- Improving our simple form-handling example -- Simple validation -- Making a contact form -- Your first form class -- Tying form objects into views -- Changing how fields are rendered -- Setting a maximum length -- Setting initial values -- Custom validation rules -- Specifying labels -- Customizing form design -- What's next? -- Chapter 7: Advanced Views and URLconfs -- URLconf Tips and Tricks -- Streamlining function imports -- Special-Casing URLs in debug mode -- Named groupsPreview -- The matching/grouping algorithm -- What the URLconf searches against -- Captured arguments are always strings -- Specifying defaults for view arguments -- Performance -- Error handling -- Including other URLconfs -- Captured parameters -- Passing extra options to view functions -- Passing extra options to include() -- Reverse resolution of URLs -- Examples -- Naming URL patterns -- URL namespaces -- Reversing namespaced URLs -- URL namespaces and included URLconfs -- What's next? -- Chapter 8: Advanced Templates -- Template language review -- Requestcontext and context processors -- auth.

DEBUG -- i18n -- MEDIA -- static -- csrf -- Request -- messages -- Guidelines for writing our own context processors -- Automatic HTML escaping -- How to turn it off -- For individual variables -- For template blocks -- Automatic escaping of string literals in filter arguments -- Inside Template loading -- The DIRS option -- Loader types -- Filesystem loader -- App directories loader -- Other loaders -- Extending the template system -- Code layout -- Creating a template library -- Custom template tags and filters -- Writing custom template filters -- Registering custom filters -- Template filters that expect strings -- Filters and auto-escaping -- Filters and time zones -- Writing custom template tags -- Simple tags -- Inclusion tags -- Assignment tags -- Advanced custom template tags -- A quick overview -- Writing the compilation function -- Writing the renderer -- Auto-escaping Considerations -- Thread-safety Considerations -- Registering the tag -- Passing template variables to The Tag -- Setting a variable in the context -- Variable scope in context -- Parsing until another block tag -- Parsing until another block tag, and saving contents -- What's next -- Chapter 9: Advanced Models -- Related objects -- Accessing ForeignKey values -- Accessing many-to-many values -- Managers -- Adding extra manager methods -- Modifying initial manager QuerySets -- Model methods -- Overriding predefined model methods -- Executing raw SQL queries -- Performing raw queries -- Model table names -- Mapping query fields to model fields -- Index lookups -- Deferring model fields -- Adding annotations -- Passing parameters into raw() -- Executing custom SQL directly -- Connections and cursors -- Adding extra Manager methods -- What's next? -- Chapter 10: Generic Views -- Generic views of objects -- Making "friendly" template contexts -- Adding extra context.

Viewing subsets of objects -- Dynamic filtering -- Performing extra work -- What's next? -- Chapter 11: User Authentication in Django -- Overview -- Using the Django authentication system -- User objects -- Creating superusers -- Creating users -- Changing passwords -- Permissions and authorization -- Default permissions -- Groups -- Programmatically creating permissions -- Permission caching -- Authentication in web requests -- How to log a user in -- How to log a user out -- Limiting access to logged-in users -- The raw way -- The login_required decorator -- Limiting access to logged-in users that pass a test -- The permission_required() decorator -- Session invalidation on password change -- Authentication views -- Login -- Logout -- Logout_then_login -- Password_change -- Password_change_done -- Password_reset -- Password_reset_done -- Password_reset_confirm -- Password_reset_complete -- The redirect_to_login helper function -- Built-in forms -- Authenticating data in templates -- Users -- Permissions -- Managing users in the admin -- Creating users -- Changing passwords -- Password management in Django -- How Django stores passwords -- Using Bcrypt with Django -- Password truncation with BCryptPasswordHasher -- Other Bcrypt implementations -- Increasing the work factor -- Password upgrading -- Manually managing a user's password -- Customizing authentication in Django -- Other authentication sources -- Specifying authentication backends -- Writing an authentication backend -- Handling authorization in custom backends -- Authorization for anonymous users -- Authorization for inactive users -- Handling object permissions -- Custom permissions -- Extending the existing user model -- Substituting a custom user model -- What's next? -- Chapter 12: Testing in Django -- Introduction to testing -- Introducing automated testing.

What are automated tests? -- So why create tests? -- Basic testing strategies -- Writing a test -- Creating a test -- Running tests -- Testing tools -- The test client -- Provided TestCase classes -- Simple TestCase -- Transaction TestCase -- TestCase -- LiveServerTestCase -- Test cases features -- Default test client -- Fixture loading -- Overriding settings -- settings() -- modify_settings() -- override_settings() -- modify_settings() -- Assertions -- Email services -- Management commands -- Skipping tests -- The test database -- Using different testing frameworks -- What's next? -- Chapter 13: Deploying Django -- Preparing your codebase for production -- Deployment checklist -- Critical settings -- SECRET_KEY -- DEBUG -- Environment-specific settings -- ALLOWED_HOSTS -- CACHES -- DATABASES -- EMAIL_BACKEND and Related Settings -- STATIC_ROOT and STATIC_URL -- MEDIA_ROOT and MEDIA_URL -- HTTPS -- CSRF_COOKIE_SECURE -- SESSION_COOKIE_SECURE -- Performance optimizations -- CONN_MAX_AGE -- TEMPLATES -- Error reporting -- LOGGING -- ADMINS and MANAGERS -- Customize the default error views -- Using a virtualenv -- Using different settings for production -- Deploying Django to a production server -- Deploying Django with Apache and mod_wsgi -- Basic configuration -- Using mod_wsgi daemon Mode -- Serving files -- Serving the admin files -- If you get a UnicodEncodError -- Serving static files in production -- Serving the site and your static files from the same server -- Serving static files from a dedicated server -- Serving static files from a cloud service or CDN -- Scaling -- Running on a single server -- Separating out the database server -- Running a separate media server -- Implementing load balancing and redundancy -- Going big -- Performance tuning -- There's no such thing as Too Much RAM -- Turn off Keep-Alive -- Use Memcached.

Use Memcached often.

About This BookGain a complete understanding of Django-the most popular, Python-based web framework in the worldGain the skills to successfully designing, developing, and deploying your appThis book is packaged with fully described code so you can learn the fundamentals and the advanced topics to get a complete understanding of all of Django's core functionsWho This Book Is For This book assumes you have a basic understanding of the Internet and programming. Experience with Python or Django would be an advantage, but is not necessary. It is ideal for beginner to intermediate programmers looking for a fast, secure, scalable, and maintainable alternative web development platform to those based on PHP, Java, and dotNET. What You Will LearnUse Django to access user-submitted form data, validate it, and work with itGet to know advanced URLconf tips and tricksExtend Django's template system with custom codeDefine models and use the database API to create, retrieve, update, and delete recordsFully extend and customize the default implementation as per your project's needsTest and deploy your Django applicationGet to know more about Django's session, cache Framework, and middlewareIn Detail Mastering Django: Core is a completely revised and updated version of the original Django Book, written by Adrian Holovaty and Jacob Kaplan-Moss - the creators of Django. The main goal of this book is to make you a Django expert. By reading this book, you'll learn the skills needed to develop powerful websites quickly, with code that is clean and easy to maintain. This book is also a programmer's manual that provides complete coverage of the current Long Term Support (LTS) version of Django. For developers creating applications for commercial and business critical deployments, Mastering Django: Core provides a complete, up-to-date resource for Django 1.8LTS with a

stable code-base, security fixes and support out to 2018.

Description based on publisher supplied metadata and other sources.

Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2024. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.

There are no comments on this title.

to post a comment.

© 2024 Resource Centre. All rights reserved.