Sign in

Django part 2

1. customize admin


Let admin page show ID, title, content

@register decorator to register the models (this does exactly the same thing as the syntax):

2. Modify model

python makemigrations
python migrate

backup database:

backup database
add feature into
add default time to create_time in
add ‘create_time’ to list_display in
add last updated time
add last updated time to
add auther (foreign key) # add foreign key to relate auther to user # on delete-> delete article won’t delete user
add delete function,