Skip to content

Apply template after overriding Django admin 🤍

Notifications You must be signed in to change notification settings

hu1won/Django_admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to use it


Install the package via PIP

$ pip install django-admin-black

  • Add 'admin_black' application to the INSTALLED_APPS setting of your Django project settings.py file (note it should be before 'django.contrib.admin'):
    INSTALLED_APPS = (
        ...
        'admin_black.apps.AdminBlackConfig',
        'django.contrib.admin',
    )
  • Make sure django.template.context_processors.request context processor is enabled in settings.py (Django 1.8+ way):
    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [],
            'APP_DIRS': True,
            'OPTIONS': {
                'context_processors': [
                    ...
                    'django.template.context_processors.request',
                    ...
                ],
            },
        },
    ]
  • Create database tables:
$ python manage.py migrate admin_black
  • Collect static if you are in production environment:
$ python manage.py collectstatic
  • Clear your browser cache

About

Apply template after overriding Django admin 🤍

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published