Python 3 Web Development Beginner's Guide

Use Python to create, theme, and deploy unique web applications

Python 3 Web Development Beginner's Guide

Beginner's Guide
Michel Anders

Use Python to create, theme, and deploy unique web applications
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Want this title & more? Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.
+ Collection
Free sample

Book Details

ISBN 139781849513746
Paperback336 pages

About This Book

  • 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

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.

Table of Contents

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
Time for action – choosing a test framework
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
Time for action – a unit convertor
Time for action – conversion using unitconverter.js
Time for action – converting a unit convertor into a plugin
Designing a spreadsheet application
Time for action – serving a spreadsheet application
The missing parts
Summary
Chapter 3: Tasklist I: Persistence
Designing a tasklist application
Time for action – creating a logon screen
Time for action – running tasklist.py
Python: the task module
Time for action – implementing the task module
JavaScript: tasklist.js
Time for action – styling the buttons
JavaScript: tooltip.js
Time for action – implementing inline labels
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
Time for action – getting the time with AJAX
Time for action – creating the task database
Time for action – retrieving information with select statements
Time for action – connecting to the database
Time for action – storing and retrieving information
Time for action – updating and deleting information
Time for action – testing factorial.py
Time for action – writing unit tests for tasklistdb.py
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
Time for action – using the Entity class
Time for action – creating instances
Time for action – using the Relation class
Time for action – defining the Books database
Time for action – designing the delivery layer
Time for action – adding a new book
Time for action – using input fields with auto completion
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
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
Time for action – using metaclasses
Time for action – implementing the MetaEntity and AbstractEntity classes
Time for action – defining new relations: how it should look
Time for action – using a table-based Entity browser
Time for action – examining the HTML markup
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

What You Will Learn

  • 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.

Authors

Table of Contents

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
Time for action – choosing a test framework
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
Time for action – a unit convertor
Time for action – conversion using unitconverter.js
Time for action – converting a unit convertor into a plugin
Designing a spreadsheet application
Time for action – serving a spreadsheet application
The missing parts
Summary
Chapter 3: Tasklist I: Persistence
Designing a tasklist application
Time for action – creating a logon screen
Time for action – running tasklist.py
Python: the task module
Time for action – implementing the task module
JavaScript: tasklist.js
Time for action – styling the buttons
JavaScript: tooltip.js
Time for action – implementing inline labels
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
Time for action – getting the time with AJAX
Time for action – creating the task database
Time for action – retrieving information with select statements
Time for action – connecting to the database
Time for action – storing and retrieving information
Time for action – updating and deleting information
Time for action – testing factorial.py
Time for action – writing unit tests for tasklistdb.py
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
Time for action – using the Entity class
Time for action – creating instances
Time for action – using the Relation class
Time for action – defining the Books database
Time for action – designing the delivery layer
Time for action – adding a new book
Time for action – using input fields with auto completion
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
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
Time for action – using metaclasses
Time for action – implementing the MetaEntity and AbstractEntity classes
Time for action – defining new relations: how it should look
Time for action – using a table-based Entity browser
Time for action – examining the HTML markup
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

Book Details

ISBN 139781849513746
Paperback336 pages
Read More

Recommended for You

Learning Python Data Visualization
$ 28.99