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

templates/base.html
templates/login.html

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

Add parameter LOGIN_REDIRECT_URL in myproject/settings.py

Step 4: Update urls.py

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

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store