Open 1003761102 opened 6 years ago
I met same problem when I used "http://localhost:8000/xadmin/." Djano2.0.2+python3.5+Xadmin0.6
我也遇到了,你解决了没有?
没有解决
解决了吗
Hi all, I just met the problem. And my solution is go to "xadmin->util.py", then search "add_js". Then you can use "media._js.extend" and "media._css.update" to replace the original one. I think the issue is related to the Django version. I hope this solution can help you.
And I just see there's a branch for django 2.0. If your Django version is >=2.0, this branch may help you: https://github.com/sshwsfc/xadmin/tree/django2
不要纠结了,肯定是你xadmin版本的问题,重新安装下django和xadmin就行了http://www.cnblogs.com/kgtest/p/8558856.html
不要纠结了,肯定是你xadmin版本的问题,重新安装下django和xadmin就行了http://www.cnblogs.com/kgtest/p/8558856.html
遇事不决,重装系统
修改xadmin util.py 中函数如下即可 def vendor(*tags): css = {'screen': []} js = [] for tag in tags: file_type = tag.split('.')[-1] files = xstatic(tag) if file_type == 'js': js.extend(files) elif file_type == 'css': css['screen'] += files return Media(css=css, js=js)
A problem of xadmin with Django 2.0 Internal Server Error: /xadmin/ Traceback (most recent call last): File "C:\Users\sidsse888\Anaconda3\lib\site-packages\django\core\handlers\exception.py", line 35, in inner response = get_response(request) File "C:\Users\sidsse888\Anaconda3\lib\site-packages\django\core\handlers\base.py", line 128, in _get_response response = self.process_exception_by_middleware(e, request) File "C:\Users\sidsse888\Anaconda3\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\sites.py", line 300, in wrapper return self.admin_view(view, cacheable)(*args, *kwargs) File "C:\Users\sidsse888\Anaconda3\lib\site-packages\django\views\decorators\cache.py", line 44, in _wrapped_view_func response = view_func(request, args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\sites.py", line 208, in inner return view(request, *args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 279, in view return handler(request, *args, *kwargs) File "C:\Users\sidsse888\Anaconda3\lib\site-packages\django\views\decorators\cache.py", line 44, in _wrapped_view_func response = view_func(request, args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\dashboard.py", line 594, in get return self.template_response('xadmin/views/dashboard.html', self.get_context()) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 78, in method return filter_chain(filters, len(filters) - 1, _inner_method, *args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 61, in filter_chain return filter_chain(filters, token - 1, _inner_method, *args, *kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 47, in filter_chain return func() File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 60, in _inner_method return fm(func if fargs[1] == '__' else func(), args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 72, in _inner_method return func(self, *args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\dashboard.py", line 587, in get_context context = super(Dashboard, self).get_context() File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 78, in method return filter_chain(filters, len(filters) - 1, _inner_method, *args, *kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 61, in filter_chain return filter_chain(filters, token - 1, _inner_method, args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 47, in filter_chain return func() File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 60, in _inner_method return fm(func if fargs[1] == '' else func(), *args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 72, in _inner_method return func(self, *args, *kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 402, in get_context context = super(CommAdminView, self).get_context() File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 78, in method return filter_chain(filters, len(filters) - 1, _inner_method, args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 61, in filter_chain return filter_chain(filters, token - 1, _inner_method, *args, **kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 47, in filter_chain return func() File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 60, in _inner_method return fm(func if fargs[1] == '' else func(), *args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 72, in _inner_method return func(self, *args, *kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 304, in get_context return {'admin_view': self, 'media': self.media, 'base_template': self.base_template} File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 308, in media return self.get_media() File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 78, in method return filter_chain(filters, len(filters) - 1, _inner_method, args, kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 47, in filter_chain return func() File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 72, in _inner_method return func(self, *args, *kwargs) File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\dashboard.py", line 624, in get_media self.vendor('xadmin.page.dashboard.js', 'xadmin.page.dashboard.css') File "C:\work\python\web\MxOnline\extra_apps\xadmin\views\base.py", line 216, in vendor return vendor(tags) File "C:\work\python\web\MxOnline\extra_apps\xadmin\util.py", line 92, in vendor media.add_js(files) AttributeError: 'Media' object has no attribute 'add_js'