Django 1.4 admin静态文件没有staticfiles应用程序 [英] Django 1.4 admin static files without staticfiles app

查看:81
本文介绍了Django 1.4 admin静态文件没有staticfiles应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Django 1.4发行说明状态:


如果您隐式依赖Django源代码中的admin静态文件
的路径,则需要更新该路径。
文件从django / contrib / admin / media /移动到
django / contrib / admin / static / admin /.

If you're implicitly relying on the path of the admin static files within Django's source code, you'll need to update that path. The files were moved from django/contrib/admin/media/ to django/contrib/admin/static/admin/.

有人可以解释这是如何完成的?直到Django 1.3,我们在settings.py中使用了ADMIN_MEDIA_PREFIX,现在已经被弃用了。但是,由于我们正在开发静态文件(js,css,...),所以staticfiles应用程序对我们来说是一个令人讨厌的nogo。每次修改后调用collectstatic是一个噩梦:-P

Could somebody explain how this is done exactly? Up to Django 1.3 we used ADMIN_MEDIA_PREFIX in settings.py, which is now deprecated. However, since we are developing all the time on our static files (js, css, ...), the staticfiles app is a rather annoying nogo for us. Calling collectstatic after each modification is a nightmare :-P

一个纯Python / Django解决方案将会很棒。如果这不可能,我们使用LighTPD作为服务器而不是Apache。

A pure Python/Django solution would be great. If that's impossible, we are using LighTPD as server and not Apache.

推荐答案

哎呀,我刚刚在Django的新文档中找到了解决方案:

Oops, I just found the solution in Django's new documentation:

https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/#serving-the-admin-files

这篇关于Django 1.4 admin静态文件没有staticfiles应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆