Skip to content

gs-gaurav-singh/loginpage-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

loginpage-django

A simple login page using django

Installation

Use the package manager pip to install django

pip install django

Create App

django admin django-admin startproject loginapp

Creating URL in project url.py

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('loginapp.urls')),
]

Creating url.py in loginapp

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'),

Creating end points views.py in loginapp

def index(request):
def loginuser(request):
def logoutuser(request):

Creating static and templates folder and mentioning it in a project setting.py

django documentation

Mention templates dir in settings.py

 'DIRS': [BASE_DIR / "templates"],

Releases

No releases published

Packages

No packages published