自定义管理 Django

Custom Admin Django

我正在尝试创建个人登录屏幕模板,但没有用。

https://github.com/rg3915/custom-admin

我配置设置:

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

创建文件夹和模板

https://github.com/rg3915/custom-admin/tree/master/myproject/core/templates_admin/admin

但是不行。

文档https://docs.djangoproject.com/en/1.9/ref/contrib/admin/#admin-overriding-templates 通知只需在应用程序内创建文件夹 templates/admin/,在我的例子中是 myproject/core/

在这种情况下,应用程序的顺序很重要。

INSTALLED_APPS = [
    # my apps
    'myproject.core',
    'django.contrib.admin',
    ...