
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Django admin widget using ACE editor for TextField.
pip install django-ace-widget
app/admin.py
from django.db import models
from django.contrib import admin
from django_ace_widget.widgets import ace_widget
from .models import Page
from .models import Block
class BlockInline(admin.TabularInline):
model = Block
extra = 0
formfield_overrides = {
models.TextField: {
# inline模式下,使用100%显示不友好,请使用px指定宽度。
"widget": ace_widget("java", width="800px"),
},
}
class PageAdmin(admin.ModelAdmin):
list_display = ["title"]
formfield_overrides = {
models.TextField: {
"widget": ace_widget("python"),
},
}
inlines = [
BlockInline,
]
admin.site.register(Page, PageAdmin)
def ace_widget(
language,
theme="xcode",
width="100%",
minLines=15,
maxLines=15,
):
"""创建AceWidget类。
参数:
language: 语言,如:html, java, python等。
theme: 编辑器皮肤。默认为:xcode。
width: 编辑器宽度。默认为:100%。可以设置为800px等。
minLines: 初始行数。默认为:15。
maxLines: 最大行数。默认为:15。
返回值:
AceWidget类
"""
FAQs
Django admin widget using ACE editor for TextField.
We found that django-ace-widget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.