[英]Django user permissions not showing in production
I have a weird problem. 我有一个奇怪的问题。 In production I can't see the user permissions list in Django admin and after opening the group edit page it shows nothing and page language transforms to another language.
在生产中,我无法在Django管理员中看到用户权限列表,在打开组编辑页面后,它没有显示任何内容,页面语言转换为另一种语言。
I have some custom permission defined in app models. 我在应用模型中定义了一些自定义权限。
What I have done: 我做了什么:
I'm using Django version 1.7. 我正在使用Django 1.7版。
Update: It looks like the problem is from gunicorn or supervisord because it's working in direct runserver. 更新:看起来问题来自gunicorn或supervisord,因为它在直接运行服务器中工作。
Problem was from os default encoding , I had some unicode permission names in my records and it's wont load and error happened . 问题是来自os默认编码,我的记录中有一些unicode权限名称,它不会加载并发生错误。
so I just add this three line in my wsgi.py 所以我只在我的wsgi.py中添加这三行
import sys
reload(sys)
sys.setdefaultencoding('utf8')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.