首页 > 解决方案 > 我想将三个 js 项目添加到 Django 项目中。谁能指导我如何更新 settings.py 文件并显示目录的树结构

问题描述

这是我的settings.py文件

STATICFILES_DIRS = [
    "/rios/search/static/",
    "/rios/user/static/",
    "node_modules"
]

STATICFILES_FINDERS = [
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'django_node_assets.finders.NodeModulesFinder',
    'npm.finders.NpmFinder'
]

NODE_PACKAGE_JSON = 'package.json'
NODE_MODULES_ROOT = 'node_modules'

我使用了这个库django-node-assets

https://pypi.org/project/django-node-assets/

该图显示了我的文件夹和文件在项目目录我的树结构中的排列方式

标签: djangothree.jsnode-modules

解决方案


推荐阅读