
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.