Book Image

Learning Django Web Development

By : Sanjeev Jaiswal, Ratan Kumar
Book Image

Learning Django Web Development

By: Sanjeev Jaiswal, Ratan Kumar

Overview of this book

<p>Django, written in Python, is a web application framework designed to build complex web applications quickly without any hassle. It loosely follows the MVC pattern and adheres to the Don't Repeat Yourself principle, which makes a database-driven application efficient and highly scalable, and is by far the most popular and mature Python web framework.</p> <p>This book is a manual that will help you build a simple yet effective Django web application. It starts by introducing Django, setting it up, and shows you how to code simple programs. You will then learn to build your first Twitter-like app. Later on, you will be introduced to Hashtags, AJAX to enhance the user interface, and tweets. You will then move on to create an administration interface, learn database connectivity, and use third-party libraries. Then you will learn to debug and deploy Django projects, and also get a glimpse of Django with AngularJS and Elasticsearch. By the end of the book, you will be able to leverage the Django framework to develop a fully functional web application with minimal effort.</p>
Table of Contents (22 chapters)
Learning Django Web Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Editing a tweet in place without loading a separate page


Editing posted content is a very common task on websites. It's usually implemented by offering an edit link next to the content. When clicked on, this link takes the user to a form located at another page, where the content can be edited. When the user submits the form, they are redirected back to the content page.

Imagine, on the other hand, that you could edit content without navigating away from the content page. When you click on the edit button, the content is replaced with a form. When you submit the form, it disappears and the updated content appears in its place. Everything happens on the same page; editing the form's rendering and submissions are done using JavaScript and AJAX. Wouldn't such a workflow be more intuitive and responsive?

The preceding technique described is called in-place editing. It now finds its way in Web applications and becomes more common. We will implement this feature in our application by letting the...