Skip to content

Instantly share code, notes, and snippets.

@neerajgupta2407
Created October 20, 2020 13:18
Show Gist options
  • Save neerajgupta2407/2474f255a4fb5a1f136288c480c91d87 to your computer and use it in GitHub Desktop.
Save neerajgupta2407/2474f255a4fb5a1f136288c480c91d87 to your computer and use it in GitHub Desktop.
File contains code to install Django-Suit , Dark theme on Django 3.1. ( Fix for sidebar issue)
# App Name: common.
# pip install https://github.com/darklow/django-suit/tarball/v2
# File: common/apps.py
from django.apps import AppConfig
from django.contrib import admin
from django.contrib.admin.apps import AdminConfig
from suit.apps import DjangoSuitConfig
class CommonConfig(AppConfig):
name = 'common'
### For Admin Panel config.
# Code for using the Dark theme.
class SuitConfig(DjangoSuitConfig):
layout = 'vertical'
class MyAdminSite(admin.AdminSite):
enable_nav_sidebar = False
class MyAdminConfig(AdminConfig):
default_site = 'common.apps.MyAdminSite'
Issue Solution: https://github.com/darklow/django-suit/issues/765
# Steps:
1. pip install https://github.com/darklow/django-suit/tarball/v2
2. copy the content from `apps.py` above
3. Update INSTALLED_APPS in settings.py.
`
'common.apps.SuitConfig', # for django suit.
# 'django.contrib.admin',
'common.apps.MyAdminConfig',
`
Enjoy!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment