Skip to content
Snippets Groups Projects
Commit 4acf1817 authored by Saif Ali's avatar Saif Ali
Browse files

Login and SignUp

parent f0359093
No related branches found
No related tags found
No related merge requests found
Pipeline #3177 failed
......@@ -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
from django.db import models
# Create your models here.
#databases models
#databases models.
from django.test import TestCase
# Create your tests here. for security
# Create your tests here. for security.
......@@ -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
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment