Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.