Django 模板是在Black Dashboard PRO之上制作的,这是一种优质的 Bootstrap 4 设计。使用Django的现代深色主题 Bootstrap 4 管理模板开始您的开发。它具有大量的组件,这些组件可以组合在一起并且看起来很棒。如果您想以流畅的工作流程更快地编码,那么您应该尝试使用著名的Python Framework
Django精心开发的模板。
注意:该产品
requires a License
才能访问主题。购买过程中,会提供GitHub Access TOKEN
。
Up-to-date Dependencies
Design
:Django 主题黑色 - PRO Version
Sections
:Django.contrib.AUTH
,注册Docker
Render
的CI/CD
流程video presentation
要进行身份验证,请使用默认凭据test/PaSS_123或在注册页面上创建新用户。
解压源文件或克隆此存储库。获取代码后,打开终端并导航到包含产品源代码的工作目录。
导出环境中的
GITHUB_TOKEN
。该值是在购买时提供的。
这是必需的,因为该项目具有私有 REPO 依赖项: github.com/app-generator/priv-django-admin-black-pro
$ export GITHUB_TOKEN= ' TOKEN_HERE ' # for Linux, Mac
$ set GITHUB_TOKEN= ' TOKEN_HERE ' # Windows CMD
$ $env :GITHUB_TOKEN = ' TOKEN_HERE ' # Windows powerShell
通过
VENV
安装模块。
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
使用模板
.env.sample
编辑.env
。
# True for development, False for production
DEBUG = True
设置数据库
$ python manage.py makemigrations
$ python manage.py migrate
创建超级用户
$ python manage.py createsuperuser
启动应用程序
$ python manage.py runserver
此时,应用程序运行在http://127.0.0.1:8000/
。
Black Dashboard PRO Django的文档托管在我们的网站上。
该项目使用如下所示的简单直观的结构进行编码:
< PROJECT ROOT >
|
| -- core/
| | -- settings.py # Project Configuration
| | -- urls.py # Project Routing
|
| -- home/
| | -- views.py # APP Views
| | -- urls.py # APP Routing
| | -- models.py # APP Models
| | -- tests.py # Tests
| | -- templates/ # Theme Customisation
| | -- includes #
| | -- custom-footer.py # Custom Footer
|
| -- requirements.txt # Project Dependencies
|
| -- env.sample # ENV Configuration (default values)
| -- manage.py # Start the app - Django default start script
|
| -- ************************************************************************
当模板文件加载到控制器中时, Django
会扫描从用户定义的模板目录开始的所有模板目录,并返回第一个匹配项,如果找不到模板则返回错误。用于设置此启动器样式的主题提供以下文件:
< LIBRARY_ROOT > # This exists in ENV: LIB/admin_black_pro
|
| -- templates/ # Root Templates Folder
| |
| | -- accounts/
| | | -- login.html # Sign IN Page
| | | -- register.html # Sign UP Page
| |
| | -- includes/
| | | -- footer.html # Footer component
| | | -- sidebar.html # Sidebar component
| | | -- navigation.html # Navigation Bar
| | | -- scripts.html # Scripts Component
| |
| | -- layouts/
| | | -- base.html # Masterpage
| | | -- base-auth.html # Masterpage for Auth Pages
| |
| | -- pages/
| | -- index.html # Index Page (presentation)
| | -- settings.html # Settings Page
| | -- dashboard.html # Dashboard page
| | -- * .html # All other pages
|
| -- ************************************************************************
当项目需要定制时,我们需要复制需要更新的原始文件(从虚拟环境)并使用相同的路径将其放置在模板文件夹中。
例如,如果我们想自定义 footer.html,请执行以下步骤:
Step 1
:在home
应用程序内创建templates
目录Step 2
:配置项目以使用这个新的模板目录core/settings.py
模板部分Step 3
:从原始位置(ENV 内)复制footer.html
并将其保存到home/templates
目录<YOUR_ENV>/LIB/admin_black_pro/includes/footer.html
<PROJECT_ROOT>home/templates/includes/footer.html
为了加快所有这些步骤的速度,代码库已配置(
Steps 1, and 2
),并且可以在此位置找到custom footer
:
home/templates/includes/custom_footer.html
默认情况下,此文件未使用,因为theme
需要footer.html
(不带custom_
前缀)。
为了使用它,只需将其重命名为footer.html
。像这样,Django 会忽略库中提供的默认版本。
以类似的方式,可以轻松自定义所有其他文件和组件。
New Blueprint Instance
按钮。repo
。Service Group Name
并单击Update Existing Resources
按钮。此时,该产品应该已上线。
目前,我们官方的目标是支持以下浏览器的最后两个版本:
我们使用 GitHub Issues 作为Black Dashboard PRO Django的官方错误跟踪器。以下是针对想要报告问题的用户的一些建议:
如果您有疑问或需要集成产品的帮助,请联系我们而不是提出问题。
Black Dashboard PRO Django - 由 Creative Tim 和 AppSeed 提供。