Professional Documents
Culture Documents
Session 7 Working With Admin Panel
Session 7 Working With Admin Panel
Working
with
Admin Panel
Session-7
simrantechmentor
Search . . .
Customer Website
01 Admin Panel
02 Customer View
simrantechmentor
Admin Panel Search . . .
01 Manage features
02 Settings
03 Dashboard
simrantechmentor
Example (Ecommerce) Search . . .
simrantechmentor
Example (Ecommerce) Search . . .
01 Order Updation
simrantechmentor
Customer View Search . . .
simrantechmentor
Search . . .
Django Admin
Search . . .
It reads metadata from your models to provide a quick, model-centric interrace where
02 trusted user can manage content on your site.
03 Note :- It is not intended for building your entire front end around.
simrantechmentor
Django Admin Site Search . . .
01 Admin site is automatically created by Django. This site is installed in your Django
project.
simrantechmentor
Django Admin Site Search . . .
simrantechmentor
Django Admin Site Search . . .
simrantechmentor
Search . . .
02 User : Is a user authenticate himself by providing username and password then Django
recognize it as a user.
03 Anonymous : if a user just surf the website without any authentication then Django
recognizes him as an Anonymous User.
simrantechmentor
Search . . .
Staff : - A user marked as staff can access the Django admin. But permissions to create,
02 read, update and delete data in the Django admin must be given explicitly to a user. By
default, a superuser is marked as staff.
active : All users are marked as active if they're in good standing. Users marked as
inactive aren't able to authenticate themselves, a common state if there's a pending
03
post-registration step (e.g. confirm email) or a user is banned and you don't want to
delete his data.
simrantechmentor
Search . . .
Group
Django also offers the concept of a Group class to grant a set of users the same set of
01 permissions without having to assign them individually.
For example, you can grant permissions to a group and then assign users to the group
02 to make permission management easier. In this manner, you can revoke or add
permissions in a single step to a set of users, as well as quickly give new users the same
permissions.
simrantechmentor
Search . . .
Create Superuser
Super user Search . . .
simrantechmentor
Django Admin Site Search . . .
simrantechmentor
Django Home Page Search . . .
01 After you successful login. You will be redirected to home page of admin
simrantechmentor
Search . . .
Open admin.py
Steps Import models
Register models to admin site
simrantechmentor
Django Admin Site Search . . .
simrantechmentor
Django Admin Home Page Search . . .
simrantechmentor
Additional ‘s’ Search . . .
simrantechmentor
Refresh Django Admin Page Search . . .
simrantechmentor
Search . . .
simrantechmentor
Search . . .
Demo : Edit/Delete
Topics
Search . . .
simrantechmentor
Show User defined value Search . . .
simrantechmentor
Refresh Search . . .
simrantechmentor
Customize admin interface Search . . .
• In order to customize admin interface we need to create a new class for each model
and inherit it from “ModelAdmin” class.
• Also we need to change the register method.
simrantechmentor
Refresh Search . . .
simrantechmentor
Make display field editable Search . . .
• Use list_editable property to include field that you want to edit directly without
clicking on object detail page.
simrantechmentor
Refresh Search . . .
simrantechmentor
Search . . .
simrantechmentor
Refresh Search . . .
simrantechmentor
Search . . .
02 There are always security concerns when dealing with user-uploaded content. Notably,
it’s important to validate all uploaded files. Django offers a large degree of flexibility to
manage user uploads.
simrantechmentor
Configuring Media files in Django Search . . .
• Open settings.py file of your project.
02 MEDIA_ROOT is the path to the root directory where the files are getting stored.
simrantechmentor
Configuring Media files in Django Search . . .
• Open urls.py file of your project.
simrantechmentor
Update models.py file Search . . .
• Open models.py file of your app.
simrantechmentor
Update admin.py file Search . . .
• Open admin.py file of your app.
simrantechmentor
Refresh Search . . .
simrantechmentor
Search . . .
simrantechmentor
Refresh Search . . .
simrantechmentor
Sort Descending Order Search . . .
• Open models.py file of your app.
simrantechmentor
Refresh Search . . .
simrantechmentor
Search . . .
simrantechmentor
Update html file Search . . .
• Open index.html file of your project.
simrantechmentor
Search . . .
THANK YOU
Kindly perform all in class exercise before coming to lab
END SLIDE
simrantechmentor
Contact No : 9878138788
Email : simran@webipher.com