Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 679 Bytes

4_DJango-admin.md

File metadata and controls

18 lines (15 loc) · 679 Bytes

DJango admin

In this we will use DJango admin to maintenance add, edit and delete news content with register class News on admin.py file.

  1. Go to on Command Prompt type cd Django01
  2. 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)
  1. Activate virtual environment with type myvenv\Scripts\activate
  2. Type python manage.py createsuperuser for create user and password at DJango admin.
  3. Run webapp with type python manage.py runserver
  4. Open browser type localhost:8000/admin on url.
  5. Login with superuser which we created earlier.