Python 3 Web Development Beginner's Guide


Python 3 Web Development Beginner's Guide
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$22.94
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
$44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Build your own Python web applications from scratch
  • Follow the examples to create a number of different Python-based web applications, including a task list, book database, and wiki application
  • Have the freedom to make your site your own without having to learn another framework
  • Part of Packt's Beginner's Guide Series: practical examples will make it easier for you to get going quickly

Book Details

Language : English
Paperback : 336 pages [ 235mm x 191mm ]
Release Date : May 2011
ISBN : 1849513740
ISBN 13 : 9781849513746
Author(s) : Michel Anders
Topics and Technologies : All Books, Web Development, Beginner's Guides, Open Source, Python, Web Development

Table of Contents

Preface
Chapter 1: Choosing Your Tools
Chapter 2: Creating a Simple Spreadsheet
Chapter 3: Tasklist I: Persistence
Chapter 4: Tasklist II: Databases and AJAX
Chapter 5: Entities and Relations
Chapter 6: Building a Wiki
Chapter 7: Refactoring Code for Reuse
Chapter 8: Managing Customer Relations
Chapter 9: Creating Full-Fledged Webapps: Implementing Instances
Chapter 10: Customizing the CRM Application
Appendix A: References to Resources
Appendix B: Pop Quiz Answers
Index
  • Chapter 1: Choosing Your Tools
    • Identifying the components of a web application
    • Time for action – getting an overview of a web application
    • Choosing suitable tools
    • Time for action – choosing a delivery framework, also known as web server
    • Time for action – choosing a server-side scripting language
    • Time for action – choosing a database engine
    • Time for action – deciding on object relational mappers
    • Time for action – choosing a presentation framework
    • Designing for maintainability and usability
      • Testing
    • Time for action – choosing a test framework
      • Version management
      • Usability
        • Good looking – adhering to common GUI paradigms
        • Themable
        • Cross-browser compatible
        • Cross-platform compatible
      • Maintainability
        • Standards compliant
      • Security
        • Reliable
        • Robust
        • Access control and authentication
        • Confidentiality
        • Integrity
        • A final word on security
      • Help, I am confused!
    • Time for action – maintaining overview
    • Summary
    • Chapter 2: Creating a Simple Spreadsheet
      • Python 3
      • Time for action – installing Python 3 CherryPy
      • Time for action – installing CherryPy
      • Installing jQuery and jQuery UI
      • Serving an application
      • Time for action – serving a dummy application
      • Time for action – serving HTML as dynamic content
        • Who serves what: an overview
        • HTML: separating form and content
      • Time for action – a unit convertor
        • HTML: form-based interaction
        • JavaScript: using jQuery UI widgets
      • Time for action – conversion using unitconverter.js
        • jQuery selectors
        • CSS: applying a jQuery UI theme to other elements
      • Time for action – converting a unit convertor into a plugin
        • JavaScript: creating a jQuery UI plugin
      • Designing a spreadsheet application
      • Time for action – serving a spreadsheet application
        • HTML: keeping it simple
        • JavaScript: creating a spreadsheet plugin
      • The missing parts
      • Summary
      • Chapter 3: Tasklist I: Persistence
        • Designing a tasklist application
        • Time for action – creating a logon screen
          • Serving a logon screen
          • Setting up a session
          • Expiring a session
          • Designing a task list
        • Time for action – running tasklist.py
        • Python: the task module
        • Time for action – implementing the task module
          • Adding new tasks
          • Deleting a task
        • JavaScript: tasklist.js
        • Time for action – styling the buttons
        • JavaScript: tooltip.js
        • Time for action – implementing inline labels
          • CSS: tasklist.css
        • Summary
        • Chapter 4: Tasklist II: Databases and AJAX
          • The advantages of a database compared to a filesystem
          • Choosing a database engine
          • Database-driven authentication
          • Time for action – authentication using a database
            • Tasklist II – storing tasks in a database
              • Improving interactivity with AJAX
          • Time for action – getting the time with AJAX
            • Redesigning the Tasklist application
            • Database design
          • Time for action – creating the task database
          • Time for action – retrieving information with select statements
            • TaskDB – interfacing with the database
          • Time for action – connecting to the database
          • Time for action – storing and retrieving information
          • Time for action – updating and deleting information
            • Testing
          • Time for action – testing factorial.py
            • Now what have we gained?
          • Time for action – writing unit tests for tasklistdb.py
            • Designing for AJAX
              • Click handlers
            • The application
          • Time for action – putting it all together
          • Have a go hero – refreshing the itemlist on a regular basis
          • Summary
          • Chapter 5: Entities and Relations
            • Designing a book database
              • The Entity class
            • Time for action – using the Entity class
            • Time for action – creating instances
              • The Relation class
            • Time for action – using the Relation class
              • Relation instances
            • Time for action – defining the Books database
              • The delivery layer
            • Time for action – designing the delivery layer
            • Time for action – adding a new book
              • Auto completion
            • Time for action – using input fields with auto completion
              • The presentation layer
            • Time for action – using an enhanced presentation layer
            • Summary
            • Chapter 6: Building a Wiki
              • The data layer
              • Time for action – designing the wiki data model
              • The delivery layer
              • Time for action – implementing the opening screen
                • The structural components
                • The application methods
              • Time for action – implementing a wiki topic screen
              • Time for action – editing wiki topics
              • Additional functionality
              • Time for action – selecting an image
              • Time for action – implementing a tag cloud
              • Time for action – searching for words
              • The importance of input validation
              • Time for action – scrubbing your content
              • Time for action – rendering content
              • Summary
              • Chapter 7: Refactoring Code for Reuse
                • Time for action – taking a critical look
                • Refactoring
                • Time for action – defining new entities: how it should look
                  • Metaclasses
                • Time for action – using metaclasses
                  • MetaEntity and AbstractEntity classes
                • Time for action – implementing the MetaEntity and AbstractEntity classes
                  • Relations
                • Time for action – defining new relations: how it should look
                  • Implementing the MetaRelation and AbstractRelation classes
                    • Adding new methods to existing classes
                  • Browsing lists of entities
                • Time for action – using a table-based Entity browser
                • Time for action – examining the HTML markup
                  • Caching
                • The books application revisited
                • Time for action – creating a books application, take two
                • Summary
                • Chapter 8: Managing Customer Relations
                  • A critical review
                  • Designing a Customer Relationship Management application
                  • Time for action – implementing a basic CRM
                  • Adding and editing values
                  • Time for action – adding an instance
                  • Time for action – editing an instance
                  • Adding relations
                  • Picklists
                  • Time for action – implementing picklists
                  • Summary
                  • Chapter 9: Creating Full-Fledged Webapps: Implementing Instances
                    • Even more relations
                    • Time for action – showing one-to-many relationships
                    • Time for action – adapting MetaRelation
                    • Time for action – enhancing Display
                    • Time for action – enhancing Browse
                    • Access control
                    • Time for action – implementing access control
                    • Role-based access control
                    • Time for action – implementing role-based access control
                    • Summary
                    • Chapter 10: Customizing the CRM Application
                      • Time for action – sorting
                      • Time for action – filtering
                      • Customization
                      • Time for action – customizing entity displays
                      • Time for action – customizing entity lists
                      • Time for action – adding a delete button
                      • Summary
                        • Appendix B: Pop Quiz Answers
                          • Chapter 2, Creating a Simple Spreadsheet
                          • Chapter 3, Tasklist I: Persistence
                          • Chapter 4, Tasklist II: Databases and AJAX
                          • Chapter 5, Entities and Relations
                          • Chapter 6, Building a Wiki

                          Michel Anders

                          Michel Anders, after his chemistry and physics studies where he spent more time on computer simulations than on real world experiments, the author found his real interests lay with IT and Internet technology, and worked as an IT manager for several different companies, including an Internet provider, a hospital, and a software development company. After his initial exposure to Python as the built-in scripting language of Blender, the popular 3D modeling and rendering suite, the language became his tool of choice for many projects. He lives happily in a small converted farm, with his partner, three cats, and twelve goats. This tranquil environment proved to be ideally suited to writing his first book, Blender 2.49 Scripting (Packt Publishing, 978-1-849510-40-0). He loves to help people with Blender and Python-related questions and may be contacted as 'varkenvarken' at http://www.blenderartists.org/ and maintains a blog on Pythonspecific subjects at http://michelanders.blogspot.com/.
                          Sorry, we don't have any reviews for this title yet.

                          Code Downloads

                          Download the code and support files for this book.


                          Submit Errata

                          Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                          Errata

                          - 6 submitted: last submission 27 Feb 2014

                          Errata type: Others | Page number: 12

                          "And while it is true that scripted languages are compiled each time they are run,"
                          should be: "And while it is true that scripted languages may be compiled each time they are run,"

                           

                          Errata type: Others | Page number: 23

                          "We wouldn't want anyone to access a paid-for web application, for example."
                          should be: "We wouldn't want anyone to access a paid-for web application for free, for example."

                           

                          Errata type: Code | Page number: 297

                          "self.validate = validate?"
                          should be: "self.validate = validate"

                           

                          Errata type: Others | Page number: 13

                          "for very lightweight cloud platforms like Google Gears, your choice of available languages might be limited. However, Python (together with Java) is fully supported by Google Gears and although this is not a consideration for the example applications in this book, it might be for your applications."

                          should be: "for very lightweight cloud platforms like Google App Engine, your choice of available languages might be limited. However, Python (together with Java) is fully supported by Google App Engine and although this is not a consideration for the example applications in this book, it might be for your applications."

                           

                          Errata type: Others | Page number: 12

                          "Interpreted languages are often simpler to debug as compiled languages"
                          should be: "Interpreted languages are often simpler to debug than compiled languages"

                           

                          Errata type: Others | Page number: 22

                          "The applications in this book use only modules provided in the standard Python distribution, with the exception of CherryPy, which is a pure Python module and should run on every platform."

                          should be: "The applications in this book use only modules provided in the standard Python distribution, with the exception of CherryPy, which is pure Python and should run on every platform."

                           

                          Sample chapters

                          You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                          Frequently bought together

                          Python 3 Web Development Beginner's Guide +    Python 3 Object Oriented Programming =
                          50% Off
                          the second eBook
                          Price for both: $20.99

                          Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                          What you will learn from this book

                          • Incorporate jQuery into your application for enhanced functionality
                          • Learn how to choose the tools that are most suitable for your needs
                          • Theme your application
                          • Secure your application by monitoring and controlling access
                          • Learn about layers using a wiki application as an example
                          • Implement a customer relations management application
                          • Design a grid component in jQueryUI to enable the user to navigate and manipulate objects in an intuitive manner
                          • Create user-configurable views to give your users greater power
                          • Design your own framework that will make developing more of your own custom applications easy

                          In Detail

                          Building your own Python web applications provides you with the opportunity to have great functionality, with no restrictions. However, creating web applications with Python is not straightforward. Coupled with learning a new skill of developing web applications, you would normally have to learn how to work with a framework as well.

                          Python 3 Web Development Beginner's Guide shows you how to independently build your own web application that is easy to use, performs smoothly, and is themed to your taste – all without having to learn another web framework.

                          Web development can take time and is often fiddly to get right. This book will show you how to design and implement a complex program from start to finish. Each chapter looks at a different type of web application, meaning that you will learn about a wide variety of features and how to add them to your custom web application. You will also learn to implement jQuery into your web application to give it extra functionality. By using the right combination of a wide range of tools, you can have a fully functional, complex web application up and running in no time.

                          A practical guide to building and customizing your own Python web application, without the restriction of a pre-defined framework

                          Approach

                          Part of Packt's Beginner's Guide Series, this book follows a sample application, with lots of screenshots, to help you get to grips with the techniques as quickly as possible.

                          Who this book is for

                          Moderately experienced Python programmers who want to learn how to create fairly complex, database-driven, cross browser compatible web apps that are maintainable and look good will find this book of most use. All key technologies except for Python 3 are explained in detail.

                          Code Download and Errata
                          Packt Anytime, Anywhere
                          Register Books
                          Print Upgrades
                          eBook Downloads
                          Video Support
                          Contact Us
                          Awards Voting Nominations Previous Winners
                          Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                          Resources
                          Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software