模板模型。
项目描述
django-template-model
描述
此应用程序将允许您将模板存储在数据库中,并使用任何模板引擎进行发现。
设置
按照以下方式编辑您的设置文件
INSTALLED_APPS = [
...
template_model,
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [ # your template dirs here
],
'APP_DIRS': False, # Disable auto discovering
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# add loader here if you want to use it with this backend
'template_model.loader.Loader',
],
},
},
版本
1.0.6 (2020-09-09)
- 支持django 3.1
1.0.5 (2020-06-09)
- 简化渲染
1.0.4 (2020-06-08)
- 处理基于文本或二进制的模板(与django-template-engines兼容)
1.0.3 (2020-06-05)
- 删除视图/URL和无用的restframework依赖项
- 现在带有加载器配置,模板可以像任何其他模板一样被发现
1.0.2 (2020-06-05)
- 添加对Python 3.8和Django 3.0的支持
- 添加加载器以处理Django模板引擎支持
1.0.1 (2019-09-24)
更新
- mimetype和magic不再使用
1.0.0
从现在起,Template
模型包含
- 一个名称(
name
), - 一个MIME类型(
mime_type
), - 一个文件(
template_file
), - 其创建日期(
added
), - 其最后更新日期(
updated
)。
0.1.1
此软件包与Django>=2.1.0,<3.0.0
和djangorestframework>=3.8.0,<3.11.0
兼容。
0.1.0
从现在起,Template
模型包含
- 一个名称,
- 一个格式,
- 内容,
- 创建日期,
- 最后更新日期。
0.0.1
Template
模型- 管理站点
- 具有额外下载模板路由的视图集
项目详情
关闭
django-template-model-1.0.6.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 319b1b83bc4ec98f9d34612f82592c9faacc90b44db73dd943649b1c5dbd809b |
|
MD5 | 1d96d87935adf52f963a5c7f24a5cd79 |
|
BLAKE2b-256 | 004828b12aef056716f92f88577cfaa5d1e7c6d1d17e907629fbea56cda253cf |