In this we will use DJango admin to maintenance add, edit and delete news content with register class News on admin.py file.
- Go to on Command Prompt type cd Django01
- Open admin.py file in \Django\blog then add and save the following script :
from django.contrib import admin
from .models import News
admin.site.register(News)- Activate virtual environment with type myvenv\Scripts\activate
- Type python manage.py createsuperuser for create user and password at DJango admin.
- Run webapp with type python manage.py runserver
- Open browser type localhost:8000/admin on url.
- Login with superuser which we created earlier.