Commit eb07ef24 authored by Aatish Neupane's avatar Aatish Neupane

add login/logout urls and templates

parent 28d06130
...@@ -13,10 +13,20 @@ Including another URLconf ...@@ -13,10 +13,20 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path 1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.conf import settings
from django.contrib import admin from django.contrib import admin
from django.urls import path, include from django.urls import path, include, re_path
from django.contrib.auth import views as auth_views
urlpatterns = [ urlpatterns = [
re_path(
'login/',
auth_views.LoginView.as_view(),
name='login'),
re_path(
'logout/',
auth_views.LogoutView.as_view(),
name='logout'),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('', include('jobs.urls')) path('', include('jobs.urls'))
] ]
{% extends 'base.html' %}
{% block title %}Login{% endblock %}
{% block body_content %}
<h2>Login</h2>
<form method="post">
{% csrf_token %} {{ form.as_p }}
<button type="submit">Login</button>
</form>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment