Skip to main content

django soho ui base

Project description

django admin ui

1、在INSTALLED_APPS中添加django_sohoui

INSTALLED_APPS = [
    'django_sohoui',
    'django.contrib.admin',
    ....
]

2、克隆静态资源到项目的静态目录

python manage.py collectstatic

3、执行makemigrations

python manage.py makemigrations
python manage.py migrate      

4、在TEMPLATES中添加context_processor

'context_processors': [
    'django.template.context_processors.debug',
    'django.template.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages',
    ## 添加custom_context
    'django_sohoui.context_processors.custom_context',
]

5、在project/urls.py中添加django_sohoui

from django_sohoui.adminsite import adminsite
urlpatterns = [
    ## 添加django_sohoui
    path('admin/', adminsite.urls),
    path('django_sohoui/', include('django_sohoui.urls')),
]

6、 在project/settings.py中添加LOGIN_BG_IMAGE(自定义登录页背景图片)

SOHO_LOGIN_BG_IMAGE = '/static/custom/images/logo_bg.jpg'

7、 在project/settings.py中添加SOHO_MENU_LIST

SOHO_MENU_LIST = {
    'show_system_menu': True,
    'models':[
        {
            'name': '自定义页面',
            'models':[
                {
                    'name': '自定义页面',
                    'admin_url': '/django_sohoui/custom_url/'
                }
            ],
        }
    ]
}

X_FRAME_OPTIONS = 'SAMEORIGIN'

# 配置首页路由地址
LOGIN_REDIRECT_URL = '/django_sohoui/home/'

8、预览

登录页

index

adminlist

adminform

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_sohoui-1.3.4.tar.gz (6.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_sohoui-1.3.4-py3-none-any.whl (6.9 MB view details)

Uploaded Python 3

File details

Details for the file django_sohoui-1.3.4.tar.gz.

File metadata

  • Download URL: django_sohoui-1.3.4.tar.gz
  • Upload date:
  • Size: 6.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for django_sohoui-1.3.4.tar.gz
Algorithm Hash digest
SHA256 7521e49241bf0f37af284897b399ca0034d03e1a78928d0d74fd9fac0d68d64e
MD5 e0ea779e8c58e8352ddfaa4af742c967
BLAKE2b-256 c54e4a8e4318bcfc88a785c68f61c503764d9c6b9f548f38dd2d50c594f66263

See more details on using hashes here.

File details

Details for the file django_sohoui-1.3.4-py3-none-any.whl.

File metadata

  • Download URL: django_sohoui-1.3.4-py3-none-any.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for django_sohoui-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e6187d113336edd063113a5de99845423e9389b86e7a3d073ca4da1efe01ecc3
MD5 f56a2fefe89a6313916423ba9b4e2407
BLAKE2b-256 20c90867e4c40a0d7880e96854642868fdd09c366ae86eb4df01f5c486ea8019

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page