在开发模式下运行 django trunk 时管理媒体消失
我最近开始接触 django 并开始学习教程和教程。文档(与开发版本)。一切都很好,直到我决定再次更新到最新的 django trunk,但我的管理媒体根本没有显示!
经过一番麻烦后,我设法通过注释掉 django.contrib.staticfiles 来显示管理媒体。但是,当我使用 staticfiles 应用程序来管理我的网站静态文件时,我需要启用它。经过一些麻烦后,我设法通过使用manage.pycollectstatic将管理媒体文件收集到我的静态文件夹来显示管理媒体和静态文件。
但是,有没有一种方法可以让我像上次一样在调试模式下轻松提供管理媒体,而无需使用收集静态命令?因为我不想每次 django admin 媒体文件在主干中更改时都调用collectstatic? (虽然我不知道这种情况有多频繁/罕见)
I got into django recently and start playing around with the tutorials & documentation (with the development version). Everything has been fine till I decide to update again to the latest django trunk and well my admin media are not showing up at all!
After some troubles, I managed to get admin media showing by commenting out django.contrib.staticfiles. However as I do use the staticfiles app to manage my site static files, I need it to be enabled. After some troubles, I manage to get both admin media and staticfiles showing by using manage.py collectstatic to collect the admin media files to my static folder.
However is there a way for me to serve admin media in DEBUG mode easily like last time without using collect static command? as I don't want to call the collectstatic every time when django admin media files got changed in trunk? (though I don't know how often/rare that is)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Django trunk 正在改变静态文件的服务方式,事实上,今天早上发生了新的变化。
您需要再次获取最新版本,然后从这里开始: http:// docs.djangoproject.com/en/dev/ref/contrib/staticfiles/
Django trunk is changing how static files are served, and in fact new changes landed this morning.
You'll want to get latest again, and then start here: http://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/