Guide Repack — Python Django-the Practical
# 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'), ]
Run tests:
from django.test import TestCase from .models import Post class PostModelTest(TestCase): def test_string_representation(self): post = Post(title="Sample") self.assertEqual(str(post), "Sample") python django-the practical guide
from django.urls import include, path urlpatterns = [ path('blog/', include('blog.urls')), ] blog/models.py # urls











