H a n d s o n, p r o j e c t b a s e d


Download 4.21 Mb.
Pdf ko'rish
bet317/344
Sana31.01.2024
Hajmi4.21 Mb.
#1818553
1   ...   313   314   315   316   317   318   319   320   ...   344
Bog'liq
Python Crash Course, 2nd Edition

407
Summary
In this chapter, you learned how to build simple web applications using the 
Django framework. You wrote a brief project specification, installed Django 
to a virtual environment, set up a project, and checked that the project was 
set up correctly. You set up an app and defined models to represent the 
data for your app. You learned about databases and how Django helps you 
migrate your database after you make a change to your models. You created 
a superuser for the admin site, and you used the admin site to enter some 
initial data.
You also explored the Django shell, which allows you to work with your 
project’s data in a terminal session. You learned to define URLs, create view 
functions, and write templates to make pages for your site. You also used 
template inheritance to simplify the structure of individual templates and 
make it easier to modify the site as the project evolves.
In Chapter 19, you’ll make intuitive, user-friendly pages that allow 
users to add new topics and entries and edit existing entries without going 
through the admin site. You’ll also add a user registration system, allow-
ing users to create an account and make their own learning log. This is the 
heart of a web app—the ability to create something that any number of 
users can interact with.



19
U s e r A c c o U n t s
At the heart of a web application is the 
ability for any user, anywhere in the world, 
to register an account with your app and 
start using it. In this chapter, you’ll build forms 
so users can add their own topics and entries, and edit 
existing entries. You’ll also learn how Django guards 
against common attacks to form-based pages so you 
don’t have to spend much time thinking about secur-
ing your apps.
You’ll also implement a user authentication system. You’ll build a regis-
tration page for users to create accounts, and then restrict access to certain 
pages to logged-in users only. Then you’ll modify some of the view func-
tions so users can only see their own data. You’ll learn to keep your users’ 
data safe and secure.



Download 4.21 Mb.

Do'stlaringiz bilan baham:
1   ...   313   314   315   316   317   318   319   320   ...   344




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling