diff --git a/accounts/apps.py b/accounts/apps.py index 85c631ff5c352c0242efb12fe4fad532b1071f30..dc467d8fd366362decf58ee4d6cf659eb24c9792 100644 --- a/accounts/apps.py +++ b/accounts/apps.py @@ -3,4 +3,4 @@ from django.apps import AppConfig class AccountsConfig(AppConfig): name = 'accounts' -#inorder to start an app \ No newline at end of file +#inorder to start an app. \ No newline at end of file diff --git a/accounts/models.py b/accounts/models.py index deeb5c92fa41f76cca233454ca97abedf12f9ab7..571052deeb9a47b512b1c010dc80650ccbbf8133 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -1,4 +1,4 @@ from django.db import models # Create your models here. -#databases models +#databases models. diff --git a/accounts/tests.py b/accounts/tests.py index f56bc78def7665f1ed37e9b5eab52c0bba911a5b..05a316a9c3b81ae5bc963c2e660bc14c009cc35f 100644 --- a/accounts/tests.py +++ b/accounts/tests.py @@ -1,3 +1,3 @@ from django.test import TestCase -# Create your tests here. for security +# Create your tests here. for security. diff --git a/accounts/urls.py b/accounts/urls.py index 181dfa336c84bc533c6d27a33e78ca19cdea93c2..7ab25437bb8c9697536ba525a6671382c8b8fab9 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -8,4 +8,4 @@ urlpatterns = [ url(r'^login/$', views.login_view, name="login"), url(r'^logout/$', views.logout_view, name="logout"), ] -#created by Saif Ali \ No newline at end of file +#created by Saif Ali. \ No newline at end of file diff --git a/accounts/views.py b/accounts/views.py index 3a6e9eb0d1239d81a3b816086292825d1de041cd..c92c1297bcff31da942e1c22e65ed16e668163d2 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -29,3 +29,7 @@ def login_view(request): form = AuthenticationForm() return render(request, 'accounts/login.html', { 'form': form }) +def logout_view(request): + if request.method == 'POST': + logout(request) + return redirect('articles:list') \ No newline at end of file