Django4 - Administration

 Let's recap Quickly


Last time we learned how to make the list in terminal (command)


python manage.py shell  

>>>from main.models import Item, ToDoList     # loading Item & ToDoList

>>> t = ToDoList.objects

>>> t.all()             

<QuerySet [<ToDoList: ToDoList object (1)>, <ToDoList: ToDoList object (2)>, <ToDoList: ToDoList object (3)>]>            

# I made three "t" in ToDoList, yours can be different.

 

When you go to http://127.0.0.1:8000/admin , you see the login page but we haven't made ID&Password. 


To make them, Following this command:

python manage.py createsuperuser 

Username (leave blank to use 'j'):  #Put your ID

Email address:  #Email address

Password:  #password

Password(again): # again

Bypass password validation and create user anyway? [y/n]  # say "yes"


Now go to the website http://127.0.0.1:8000/admin and log in



you can see the Django administration

Items & ToDoLists  that we've made ! 


You can delete or revise the user's information here as well !



Popular posts from this blog

[Python] Dictionary

[Visual Design 2/3]

[JavaScript] For loop , Function