Run tests:
Now visit /admin to manage data. blog/views.py (using templates)
python manage.py createsuperuser
Apply migrations:
def __str__(self): return self.title
# urls.py from django.contrib.auth import views as auth_views urlpatterns += [ path('login/', auth_views.LoginView.as_view(), name='login'), path('logout/', auth_views.LogoutView.as_view(), name='logout'), ]
python manage.py makemigrations python manage.py migrate python django-the practical guide
# Create Post.objects.create(title="Hello", content="World") posts = Post.objects.all() post = Post.objects.get(id=1) Update post.title = "New Title" post.save() Delete post.delete() 6. Django Admin Interface Create a superuser:
