所有表重建之后报错

来源:5-2 xadmin的安装

不 弃丶

2017-03-25

http://szimg.mukewang.com/58d67b6f0001f67024121162.jpg


这个问题怎么解决???
集成xadmin之后把所有表删除了。然后重建出来之后进入xadmin就报错。
http://szimg.mukewang.com/58d67bd700018e2609280952.jpg

所有表

写回答

2回答

bobby

2017-03-26

你要下面具体的报错贴全, 把你的所有错误代码全部贴上 或者贴出你出错的那行代码

1
1
不 弃丶
已经解决了。项目新建的时候选的虚拟环境创建的数据库,然后切换虚拟环境之后生成数据库就会有这个报错。
2017-03-27
共1条回复

不 弃丶

提问者

2017-03-27

Environment:



Request Method: GET

Request URL: http://127.0.0.1:8000/xadmin/


Django Version: 1.9.8

Python Version: 2.7.10

Installed Applications:

['django.contrib.admin',

 'django.contrib.auth',

 'django.contrib.contenttypes',

 'django.contrib.sessions',

 'django.contrib.messages',

 'django.contrib.staticfiles',

 'users',

 'courses',

 'organization',

 'operation',

 'xadmin',

 'crispy_forms']

Installed Middleware:

['django.middleware.common.CommonMiddleware',

 'django.middleware.csrf.CsrfViewMiddleware']




Traceback:


File "/Users/jacob/.virtualenvs/mxonline/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  149.                     response = self.process_exception_by_middleware(e, request)


File "/Users/jacob/.virtualenvs/mxonline/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)


File "/Users/jacob/.virtualenvs/mxonline/lib/python2.7/site-packages/xadmin/sites.py" in wrapper

  292.                 return self.admin_view(view, cacheable)(*args, **kwargs)


File "/Users/jacob/.virtualenvs/mxonline/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func

  57.         response = view_func(request, *args, **kwargs)


File "/Users/jacob/.virtualenvs/mxonline/lib/python2.7/site-packages/xadmin/sites.py" in inner

  198.             if not self.has_permission(request) and getattr(view, 'need_site_permission', True):


File "/Users/jacob/.virtualenvs/mxonline/lib/python2.7/site-packages/xadmin/sites.py" in has_permission

  155.         return request.user.is_active and request.user.is_staff


Exception Type: AttributeError at /xadmin/

Exception Value: 'WSGIRequest' object has no attribute 'user'


0
0

Python3.6+django+xadmin,打造在线教育平台

【毕设】Python 2.7到3.6 完美适配,Django升级2.0

3677 学习 · 4038 问题

查看课程