Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

django-base-ai

Latest version: v1.0.172

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
PyPI package Publisher: wangcongxing
69 Versions
9.8K Downloads

Scan summary

django-base-ai was last scanned on 27 Nov 2026 at version 1.0.172. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 69 versions; the latest 5 were published within 3 days (25–27 Nov 2026).
  • Findings: 2 rules fired in version 1.0.172 (5 instances: 4 medium, 1 low). The score describes this version only.
  • Downloads: 9,752 downloads.

Versions

69 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.172 LATEST 27 Nov 2026 2 rules fired
1.0.171 27 Nov 2026 2 rules fired
1.0.170 26 Nov 2026 2 rules fired
1.0.169 26 Nov 2026 Not shown
1.0.168 25 Nov 2026 Not shown

Rules fired in 1.0.172: 2

Findings

4 Medium 1 Low

Findings for v1.0.172. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

Function reached through a chain of indirect calls

The code obtains a function through a computed property lookup whose key is not a plain literal, calls it, and then calls the value it returns. Obfuscated loaders use this double indirection to reach the Function constructor without its name appearing in the source. This is a code shape, not evidence of intent, and is shown to help review obfuscated code.

MEDIUM

Secret exposed in source code

LOW
Checking access…

🔒 Create a free account to see all 5 findings with descriptions and instance counts

The score describes 1.0.172; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

DjangoBaseAi

Django 通用底座:在 Django + DRF 之上提供企业级底座(认证、RBAC、组织架构、操作/登录日志、文件与消息等),产品业务(对话、文档、PPT、IM 协作等)放在消费方仓库,不要写进本包。

给 AI / 后续模块开发:先读 AGENT.md。

  • 包名:django-base-ai(导入名:django_base_ai)
  • 快速开始:快速开始
  • 多租户(默认关闭):多租户
  • 插件中心:插件中心
  • OAuth2 统一登录门户:OAuth2 第三方接入
  • 个人中心授权码:个人中心授权码 ac_code

快速开始(首次使用)

使用 pip 安装,在新建或已有 Django 项目中按文档配置即可,无需克隆仓库、无需 MySQL/Redis(SQLite + 内存缓存)。

pip install django-base-ai
django-admin startproject myproject && cd myproject

然后在项目的 settings.py 中先 from django_base_ai.settings import *,再按本文「快速开始」配置数据库(SQLite)、缓存(内存)、INSTALLED_APPS、MIDDLEWARE、路由等;执行 migrate、runserver 即可访问。建议再执行 python manage.py init 初始化菜单/角色/字典。对话与 PPT HTTP 接口在产品仓库,不在本包。

发布时前端:在本仓执行 ./build.sh 会自动在同级 ../DjangoBaseAiWeb(或本仓 ./web)跑 npm run build:pack,再拷入 django_base_ai/adminweb/ 打进 wheel。不必再手动打包/拷贝。跳过重编:SKIP_FRONTEND_BUILD=1 ./build.sh。

管理后台(零配置):wheel 内已打入 DjangoBaseAIWeb 生产构建。只要 INSTALLED_APPS 含 django_base_ai.system,启动后打开:

http://ip:port/admin/          # 管理端 SPA
http://ip:port/admin/#/login   # 登录页(hash 路由)

接口仍走同源 http://ip:port/base/api/system/...,不必再单独部署前端或配 nginx 静态目录。


配置参数关系与效果

底座配置写在业务项目的 settings.py(先 from django_base_ai.settings import *,再按需覆盖)。下面按「谁依赖谁 → 能得到什么」说明;未列出的项保持底座默认即可跑通。

1. 管理端页面(adminweb)
参数 默认 依赖关系 效果
django_base_ai.system ∈ INSTALLED_APPS 必选 触发 AppConfig.ready() 启动时尝试自动挂载管理端路由
ADMINWEB_AUTO_MOUNT True 依赖上一项;且 wheel 内存在 django_base_ai/adminweb/index.html True:自动挂到根 URLconf;False:不挂,需自行 include
ADMINWEB_MOUNT_PATH "/admin/" 仅在自动挂载开启时生效 浏览器访问前缀;/admin 会 302 到带尾斜杠的路径
包内 adminweb/ 发布机 build:pack + bundle 打进 wheel 无产物则跳过挂载并打日志 提供 index.html 与 `static/js

关系简述:

pip 安装(含 adminweb)
    → INSTALLED_APPS 含 django_base_ai.system
        → ADMINWEB_AUTO_MOUNT=True(默认)
            → 挂载 ADMINWEB_MOUNT_PATH(默认 /admin/)
                → 打开 /admin/ 即管理端;API 仍用 /base/api/system/

关闭示例:

ADMINWEB_AUTO_MOUNT = False
# 或改挂载前缀:
# ADMINWEB_MOUNT_PATH = "/console/"
2. 接入底座 API 的最小三角
参数 / 配置 默认或示例 依赖关系 效果
from django_base_ai.settings import * — 最先执行 带入 DRF / JWT / 分页 / 认证 / 异常处理等默认
INSTALLED_APPS 含 django_base_ai.system — 依赖 Django 应用加载 模型、迁移、管理命令、/admin/ 自动挂载
urls.py:path("base/api/system/", include("django_base_ai.system.urls")) — 与上一项配合 暴露登录、用户/角色/部门、菜单、字典等 HTTP API
SECRET_KEY / 环境变量 DJANGO_SECRET_KEY 开发有占位;ENV=pro 必填真密钥 JWT / session 签名 多应用共用同一密钥可共享登录态;生产禁止 django-insecure

缺路由则只有页面没有接口;缺 system 应用则页面也不会自动挂载。

未匹配的 /base/api/ 即使 DEBUG=True 也返回 JSON 404,而不是 Django 技术黄页。非 API 页面(例如 /admin/)仍保留原来的 DEBUG 黄页。

参数 默认 效果
API_JSON_404_ENABLED True False 时不再改写 404,API 路径也会回到 Django 的 HTML 404
API_JSON_404_PREFIXES ["/base/api/"] 要改写成 JSON 的前缀。覆盖此列表会替换默认值
API_JSON_404_EXTRA_PREFIXES [] 只追加、不替换。产品前缀写在宿主,例如 ["/docs/app/"]

django_base_ai.system 就绪时,若 MIDDLEWARE 里还没有 ApiJson404Middleware,会插到 CORS 之后、CommonMiddleware 之前。JSON 体与底座 Http404 口径一致:{"code": 400, "data": null, "msg": "接口地址不正确"},HTTP 状态为 404。

3. 运行环境与数据面
参数 典型值 依赖关系 效果
DATABASES SQLite 或 MySQL ORM / 迁移 存用户、角色、菜单、日志等
REDIS_MODE / CACHES / CHANNEL_LAYERS memory 或 Redis 缓存、Channels、部分限流 quickstart 用内存即可;生产建议 Redis
DISPATCH_DB_TYPE "memory" / 库 字典与系统配置调度 控制配置缓存后端
CORS_ALLOWED_ORIGINS 同源可空;跨域需显式列表 浏览器跨域调 API 管理端与 API 不同源时必配
ALLOWED_HOSTS 开发可用 ["*"] Django 主机校验 生产必须写成真实域名/IP
4. 初始化与权限相关开关
参数 默认 效果
python manage.py migrate — 创建底座表结构
python manage.py init — 导入菜单 / 角色 / 字典等 fixtures
INITIALIZE_DEPT_AND_USERS True init 时是否初始化部门与用户
INITIALIZE_ALL_USERS True False 时 init 只保留第一个用户(admin)
LICENSE_VERIFY_ENABLE False 打开后按 License 拦截;/admin、/healthy 等在默认排除列表
5. 运维页(可选)
参数 默认 效果
CELERY_OPS_QUEUES ["celery", "vector", "skill"] 管理端「任务状态」巡检的队列名
SUPERVISOR_SOCKET /var/run/supervisor.sock 「进程守护」连本机 Supervisor
SUPERVISOR_CONTROL_ENABLED True 是否允许启停进程
SUPERVISOR_NODES / SUPERVISOR_AGENT_TOKEN 空 多机 Supervisor 代理查询

这些只影响管理端运维菜单对应的 API,不影响 /admin/ 页面能否打开。


痛点与解决方案
痛点 解决方案
想快速接入大模型能力,又不想从零搭权限与基础 底座提供认证、RBAC、日志与 utils.ai 客户端;对话/PPT HTTP 由产品 app 接入
企业系统权限需求复杂,自建 RBAC 成本高、易遗漏 完整 RBAC:用户、角色、部门、菜单、按钮权限、接口白名单、数据权限过滤,开箱即用
国内大型企业组织架构明确、层级多、权限要求严 部门树、懒加载、数据权限按部门/角色过滤,贴合「组织架构清晰、权限分级严格」的国内企业场景
每个项目重复实现登录、字典、文件、日志等基础能力 统一认证(JWT、单点登录、验证码)、字典/系统配置、文件与文件夹、操作日志、消息中心等一应俱全
希望快速接入企业规范,而非从零搭架子 安装依赖、配置 INSTALLED_APPS 与路由后,一键集成到现有 Django 项目,无需重写权限与基础模块
技术信息
  • Python:3.9+

功能概览

主推:AI 能力
模块 说明
AI 客户端 django_base_ai.utils.ai:多供应商 Chat / 生图,供产品 app 调用

配置 AI 供应商(见 conf/env.py 或文档)后即可使用,无需改业务代码。

底座核心(通用能力,支撑 AI 与业务)
模块 说明
认证 JWT(SimpleJWT)、单点/第三方登录、验证码、登出、Token 刷新
RBAC 用户、角色、部门、菜单、按钮权限、接口白名单、数据权限过滤
系统配置 字典、系统配置键值、调度中心(dispatch)、初始化接口
审计与日志 操作日志、登录日志、日志文件分析/下载/实时 tail
文件与存储 文件夹、文件上传/列表/下载、导入导出(Excel)
消息与协作 消息中心、常用联系人、协作人、我的上级、WebSocket
任务与配置 基础任务、任务历史、应用/标签、数据可视化配置
工具 统一 JSON 响应、分页、异常处理、权限校验、加解密、节假日、健康检查等
其他扩展(按需使用)
模块 说明
数据分析 通用分析视图(base_analyze)
数据可视化 看板/大屏配置(datav)

IM 协作会话、员工服务、CMDB 不在本包;由消费方(如 DocsAI)自行提供。


统一响应格式

除流式接口与 WebSocket 外,接口均采用以下 JSON 结构。

成功

分页列表(list 等):

{
  "code": 2000,
  "msg": "success",
  "data": {
    "page": 1,
    "limit": 10,
    "total": 100,
    "is_next": true,
    "is_previous": false,
    "data": [ /* 当前页列表 */ ]
  }
}

单条/非分页(retrieve、create、update、部分自定义接口):

{
  "code": 2000,
  "msg": "success",
  "data": { /* 单条对象或业务结构 */ }
}
错误
{
  "code": 400,
  "msg": "错误说明",
  "data": null
}

业务错误码可能为 4xxx(如 4000 登录失败、401 未授权等),status 为 HTTP 状态码。


暴露的 API 接口

以下路径均以 /base/api/system/ 为前缀(由主项目 urls.py 挂载决定)。


认证与登录(无需 Token)

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases django-base-ai

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229