2022-09-25 19:38阅读: 98评论: 0推荐: 0

django静态资源收集

local_settings.py

import os
from pathlib import Path
DEBUG = False
ALLOWED_HOSTS = ['*']
BASE_BASE_DIR = Path(__file__).resolve().parent.parent.parent
# 在项目同级目录allstatic收集静态资源
STATIC_ROOT = os.path.join(BASE_BASE_DIR, "allstatic")

settings.py

try:
    from .local_settings import *
except Exception as e:
    print(e)

执行命令

python3 manage.py collectstatic

静态资源有变动就要执行

本文作者:Sherwin

本文链接:https://www.cnblogs.com/sherwin1995/p/16728594.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Sherwin_szw  阅读(98)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.