当我给出命令“python manage.py collectstatic”时,出现以下问题
"0 static files copied to '/home/leonard368a/leonard368a.pythonanywhere.com/static', 119 unmodified."
谁有办法解决这个问题?
命令行:
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
STATIC_ROOT = "/static/"
最佳答案
Collectstatic命令使用,当你想在服务器上部署你的项目时,命令将本地的所有静态文件复制到服务器这是这个命令的主要用途,它也可以在本地使用但主要用于复制所有文件并放在服务器文件管理器上,
In your case you use the
STATICFILEES_DIRS
andSTATIC_ROOT
are same so in local file system copy static dir to static that why you need to changeSTATIC_ROOT='asset'
orSTATIC_ROOT = os.path.join(BASE_DIR, 'asset')
in your root dir
static file configration in python any where
collect static in python any where
如果成功了告诉我
关于django - 发出命令时出现静态错误 "python manage.py collectstatic",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60470995/
相关文章:
android-studio - 如何禁用 Android-Studio 3.6 中引入的多预览功能
java - 使用 Jacoco Agent 远程触发 jacoco 执行数据转储
flutter - 是否可以通过 UDP/TCP 从 flutter 应用程序向 .NET 应用程序
imagemagick - 由于 magick_image_readpath 中的错误,无法将 ka
amazon-web-services - 如何在不破坏池的情况下使 Cognito 用户池电子邮件
reactjs - 故事书:ReferenceError: Jest 未定义