简体   繁体   中英

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.

I have some custom permission defined in app models.

What I have done:

  1. Sync my local database with production database.
  2. Setting default encoding in supervisor (I thought maybe if my app verbose name is a Unicode name so that's why it won't load)

I'm using Django version 1.7.

Update: It looks like the problem is from gunicorn or supervisord because it's working in direct runserver.

Problem was from os default encoding , I had some unicode permission names in my records and it's wont load and error happened .

so I just add this three line in my wsgi.py

import sys
reload(sys)
sys.setdefaultencoding('utf8')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM