A simple login page using django
Use the package manager pip to install django
pip install django
django admin django-admin startproject loginapp
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('loginapp.urls')),
]
from django.contrib import admin
from django.urls import path
from loginapp import views
urlpatterns = [
path('', views.index, name='home'),
path('login', views.loginuser, name='login'),
path('logout', views.logoutuser, name='logout'),
def index(request):
def loginuser(request):
def logoutuser(request):
Mention templates dir in settings.py
'DIRS': [BASE_DIR / "templates"],