Django Admin Custom Login Page

Rendering django admin login page with customized html file (with bootstrap).

Step 1: Preparation, Create Django Project, Initial Migration
Install virtualenv: pip install virtualenv
Create virtualenv: virtualenv venv
Start virtualenv: venv/Scripts/activate
Install Django in virtualenv: pip install django
Create Django: django-admin startproject myproject
Go to myproject folder: cd myproject
Initial Migration: python manage.py migrate
Create superuser: python manage.py superuser

Step 2: Preparing Template and HTML files
Create templates folder, base.html, login.html

Step 3: Setup settings.py
Add template folder in TEMPLATES parameter in myproject/settings.py

'DIRS': [os.path.join(BASE_DIR, 'myproject', 'templates')],

Add parameter LOGIN_REDIRECT_URL in myproject/settings.py

LOGIN_REDIRECT_URL = '/admin'

Step 4: Update urls.py

Step 5: Run server
Run server: python manage.py runserver

Software Engineer