Django 4 for the Impatient - Greg Lim - E-Book

Django 4 for the Impatient E-Book

Greg Lim

0,0
29,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Learning Django can be a tricky and time-consuming activity. There are hundreds of tutorials, loads of documentation, and many explanations that are hard to digest. However, this book enables you to use and learn Django in just a couple of days.
In this book, you’ll go on a fun, hands-on, and pragmatic journey to learn Django full stack development. You'll start building your first Django app within minutes. You'll be provided with short explanations and a practical approach that cover some of the most important Django features, such as Django Apps’ structure, URLs, views, templates, models, CSS inclusion, image storage, authentication and authorization, Django admin panel, and many more. You'll also use Django to develop a movies review app and deploy it to the internet.
By the end of this book, you'll be able to build and deploy your own Django web applications.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 122

Veröffentlichungsjahr: 2022

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Django 4 for the Impatient

Learn the core concepts of Python web development with Django in one weekend

Greg Lim

Daniel Correa

BIRMINGHAM—MUMBAI

Django 4 for the Impatient

Copyright © 2022 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Associate Group Product Manager: Pavan Ramchandani

Publishing Product Manager: Bhavya Rao

Senior Editor: Mark Dsouza

Content Development Editor: Divya Vijayan

Technical Editor: Saurabh Kadave

Copy Editor: Safis Editing

Project Coordinator: Ajesh Devavaram

Proofreader: Safis Editing

Indexer: Tejal Daruwale Soni

Production Designer: Vijay Kamble

Marketing Coordinator: Anamika Singh and Marylou De Mello

First published: June 2022

Production reference: 1170622

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80324-583-6

www.packt.com

To my awesome wife for taking such good care of our family and children that I could embark on my writing journey. She and our family are the very reason why I write books like this. Thank you so much, dear.

– Greg Lim

To my mother, my ultimate hero.

– Daniel Correa

Contributors

About the author

Greg Lim is a technologist and the author of several books on programming. He has taught programming in tertiary institutions for many years and places a strong emphasis on learning by doing. Follow Greg on Twitter at @greglim81

"I want to thank Daniel, my talented co-author; without him, this book wouldn't have been possible. Thanks also to everyone on the Packt team who helped us so much."

Daniel Correa is a researcher, software developer, and author of programming books. He has a PhD in computer science. He is a professor at Universidad EAFIT in Colombia. He is interested in software architectures, frameworks (such as Laravel, Nest, Django, Express, Vue, React, and Angular), web development, and clean code. Follow Daniel on Twitter at @danielgarax

"I want to thank Greg for letting me be part of this project. Greg is one of the best programming book authors I have known. Thanks to my wife, family, colleagues, and friends for all the support. Finally, thanks to the entire Packt team for the meticulous work to publish this book."

About the reviewer

Abdelrahman Mostafa is an Egyptian Python developer, YouTuber, and consultant at the SmartSystem company in IBM's Maximo product. He has more than 4 years of experience in the field of web development. He graduated from the Faculty of Computer Science at Assiut University. He has developed many websites for major companies using the Django framework. In his spare time, he likes to play sports, especially boxing and bodybuilding, and one of his hobbies is constantly learning new things.

"I'd like to thank my family and friends who understand the time and commitment it takes to review this book. I'd also like to thank my father, who helped me and taught me – may he rest in peace. I truly believe all of us in the technical world are standing on the shoulders of giants. The giants for me are my leaders, Eng Alaa Hassab, Eng Ahmed Gomaa, Eng Islam Yahya and more who have left a mark on my working life and helped me achieve my goal."

Sai Vivek Annamneni is an Application developer who has worked in Fujitsu, Accenture for 4 years in various evolving technologies like Python, AWS, Django for many projects like web applications in various industries like stock market, insurance, and Ecom. Also, he's involved in problem solving algorithms.

By qualification, he has a Master's degree in the stream of Computer Science from River University, Nashua in United States. Actively working to Found a startup with multiple streams of services and Products in the STAFFING industry in USA.

Mahmoud Abou-Elnaga is a software engineer from Egypt working as a freelancer who has taken many courses and certificates such as the Advanced Django course offered by Duke University and many courses on Udemy.

Table of Contents

Preface

Chapter 1: Installing Python and Django

Technical requirements

Understanding the app we will be building

Installing Python

Installing Django

Running the Django local web server

Summary

Chapter 2: Understanding the Project Structure and Creating Our First App

Technical requirements

Understanding the project structure

The moviereviews folder

manage.py

db.sqlite3

Creating our first app

Summary

Chapter 3: Managing Django URLs

Technical requirements

Understanding and defining Django URLs

Creating a custom path for a home page

Creating a custom path for an about page

Summary

Chapter 4: Generating HTML Pages with Templates

Technical requirements

Understanding Django templates

Template

View

URLs

Passing data into templates

Adding Bootstrap to our site

Adding a search form

Sending a form to another page

Creating a back link

Summary

Chapter 5: Working with Models

Technical requirements

Creating our first model

Installing pillow

Managing migrations

Accessing the Django admin interface

Configuring for images

Serving the stored images

Adding a movie model to admin

Summary

Chapter 6: Displaying Objects from Admin

Technical requirements

Listing movies

Using the card component

Implementing a search

Adding a news app

News model

Listing news

Summary

Chapter 7: Understanding the Database

Technical requirements

Understanding the database viewer

Displaying object information in admin

Switching to a MySQL database

Configuring the MySQL database

Configuring our project to use the MySQL database

Running the migrations

Summary

Chapter 8: Extending Base Templates

Technical requirements

Creating a base template

Making the links work

Adding a footer section

Serving static files

Summary

Chapter 9: Creating a Movie Detail Page

Technical requirements

Creating a movie page

Implementing links to individual movie pages

Summary

Chapter 10: Implementing User Signup and Login

Technical requirements

Creating a signup form

Creating a user

Handling user creation errors

Checking whether passwords do not match

Checking if a username already exists

Customizing UserCreationForm

Using UserCreateForm

Showing whether a user is logged in

Implementing the logout functionality

Implementing the login functionality

Summary

Chapter 11: Letting Users Create, Read, Update, and Delete Movie Reviews

Technical requirements

Letting users post movie reviews

Creating a review

Listing reviews

Updating a review

Deleting a review

Implementing authorization

Summary

Chapter 12: Deploying the Application to the Cloud

Technical requirements

Managing GitHub and Git

Cloning our code on to PythonAnywhere

Configuring virtual environments

Setting up your web app

Configuring static files

Set DEBUG to False

.gitignore

Changing db.sqlite3 to MySQL or PostgresSQL

Summary

Why subscribe?

Other Books You May Enjoy

Chapter 1: Installing Python and Django

Welcome to Django 4 for the Impatient! This book focuses on the key tasks and concepts to help you to learn and build Django applications fast. It is designed for readers who don't need all the details about Django except for concepts that you really need to know. By the end of this book, you will be confident creating your own Django projects.

So, what's Django? Django is a free, open source web framework for building modern Python web applications. Django helps you quickly build web apps by abstracting away many of the repetitive challenges involved in building a website, such as connecting to a database, handling security, enabling user authentication, creating URL routes, displaying content on a page through templates and forms, supporting multiple database backends, and setting up an admin interface.

This reduction in repetitive tasks allows developers to focus on building a web application's functionality rather than reinventing the wheel for standard web application functions.

Django is one of the most popular frameworks available and is used by established companies such as Instagram, Pinterest, Mozilla, and National Geographic