Django,没有任何东西保存在根折叠中

2024-04-25 05:26:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我阅读Django文档的方式django.contrib.staticfiles文件'应用程序从应用程序收集静态内容,将它们放在static\u ROOT指定的文件夹中。在那之后它就可以从那里发球了。你知道吗

但即使指定的文件夹不存在或为空(如果管理.py尚未调用collectstatic)。你知道吗

怎么做?你知道吗

Django测试服务器仍然提供文件服务,例如管理介质: http://localhost:8000/static/admin/css/base.css

(Django 1.3.1)


Tags: 文件django文档文件夹应用程序内容方式静态
1条回答
网友
1楼 · 发布于 2024-04-25 05:26:21

本地开发不需要collectstatic,只有在以后部署到生产环境时才需要:

For local development, if you are using runserver or adding staticfiles_urlpatterns to your URLconf, you’re done with the setup

请参见:

https://docs.djangoproject.com/en/1.3/howto/static-files/#basic-usage

https://docs.djangoproject.com/en/1.3/howto/static-files/#deploying-static-files-in-a-nutshell

相关问题 更多 >