IT study/python

django 9 - Create View & messages

까자미가 카카로트냐 2018. 5. 17. 21:58



1. create create_method


2. create new forms.py file 


3. import form into the views.py 


4. register url for create view



5. create.html

form.as_p (????)


6. post method


7. 



8. better method

form.save(commit=False) 는 여기서 ModalForm을 사용하기 때문이다 .



9. insert into the db





10. directly go to the detail view when creating new item



11. message handling 



12. detail_view.html



13.  views.py



14. completed create_view.py



Django Messages

1. views.py


2. detail_view.html


3.


4. display message in create form and put the html code into the create.html