Skip to main content

DJANGO 数据库增强

Django Kelove Setting Version Python Version Django Version LICENSE

主要功能

  • 迁移支持写入表注释及字段注释

  • 迁移支持写入字段默认值

  • 在线数据库设计文档生成

  • CKFinder文件上传字段集成

  • CKEditor编辑器字段集成

  • Markdown编辑器字段集成

  • JSON字段集成

需要加载的应用模块

INSTALLED_APPS = [
    ...
    # 配置管理插件
    'django_kelove_setting',
    # 数据库增强插件
    'django_kelove_database',
    ...
]

需要添加的路由地址

from django.urls import path, include

urlpatterns = [
    ...
    # 数据库增强(主要用于ckfinder文件上传)
    path('database/', include('django_kelove_database.urls', namespace='django_kelove_database')),
    ...
]

MySQL配置示例

DATABASES = {
    'default': {
        'ENGINE': 'django_kelove_database.db.backends.mysql',
        'NAME': 'test',
        'USER': 'root',
        'PASSWORD': 'root',
        'HOST': '127.0.0.1',
        'PORT': 3306,
        # 'INCLUDE_DEFAULT': True,
        'INCLUDE_DEFAULT': lambda model, field, include_default, connection: False if field.db_parameters(
            connection=connection
        )['type'] in ['longtext', 'longblob'] else True,
        'OPTIONS': {'charset': 'utf8mb4'}
    }
}

扩展字段使用示例

from django.db import models

from django_kelove_database.db import fields


class FieldDemo(models.Model):

    json_field = fields.JSONField(verbose_name='JSON演示', blank=True, null=False, default=dict)

    ck_finder_field = fields.CkFinderField(verbose_name='文件上传', max_length=191, blank=True, null=False, default='')

    editor_md_field = fields.EditorMdField(verbose_name='Markdown编辑器', blank=True, null=False, default='')

    editor_ck_field = fields.EditorMdField(verbose_name='Ckeditor', blank=True, null=False, default='')

Metadata

Release files for django-kelove-database 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for django-kelove-database 2.0.0
File Interpreter ABI Platform Actions
django_kelove_database-2.0.0-py3-none-any.whl Python 3 none any Details for django_kelove_database-2.0.0-py3-none-any.whl

Release files / django_kelove_database-2.0.0-py3-none-any.whl

Download URL django_kelove_database-2.0.0-py3-none-any.whl
Size 6.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
35ea5df24be8953ac4b89da312c3bfe0a39aee2b31701fa582eea6c480f70148
BLAKE2b-256 checksum
How to use checksums
9c3d08d78895397a71fa9bc26ab5d8b20fdfbc1599ec692f06b40d0261c9fe66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.7.10 Linux/5.11.0-051100-generic

Security for django-kelove-database 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page