Important Commands about Admin Pannel
===================================================================================7: Registering Models To Admin Panel
=================================================================================== to registered your model in admin pannel 1) open admin.py and write the following code from. models import News, SportNews admin.site.register(News) admin.site.register(SportNews) 2) Now you open admin pannel http://127.0.0.1:8000/ and you will see the table News and SportNews but we cannet see the auto author for this we need put the following code in model.py files class sportnews(models.model) --- -- def _str_(self): return self.author Class News (models.model) --- --- def _str_(self): return self.author
===================================================================================References
===================================================================================
Last modified: Sunday, 2 February 2020, 11:46 AM