添加轮播图时报错
来源:5-3 users app 的model注册
0我思故我在0
2019-06-29
Internal Server Error: /xadmin/users/banner/add/
Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py”, line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py”, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/sites.py”, line 306, in wrapper
return self.admin_view(view, cacheable)(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/django/views/decorators/cache.py”, line 57, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/sites.py”, line 211, in inner
return view(request, *args, **kwargs)
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/base.py”, line 279, in view
return handler(request, *args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/django/utils/decorators.py”, line 67, in _wrapper
return bound_func(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/django/utils/decorators.py”, line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/django/utils/decorators.py”, line 63, in bound_func
return func.get(self, type(self))(*args2, **kwargs2)
File “/usr/lib/python3.6/contextlib.py”, line 52, in inner
return func(*args, **kwds)
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/base.py”, line 78, in method
return filter_chain(filters, len(filters) - 1, _inner_method, *args, **kwargs)
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/base.py”, line 47, in filter_chain
return func()
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/base.py”, line 72, in _inner_method
return func(self, *args, **kwargs)
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/edit.py”, line 292, in post
self.save_models()
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/base.py”, line 78, in method
return filter_chain(filters, len(filters) - 1, _inner_method, *args, **kwargs)
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/base.py”, line 47, in filter_chain
return func()
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/base.py”, line 72, in _inner_method
return func(self, *args, **kwargs)
File “/home/tarena/PycharmProjects/mxonline/extra_apps/xadmin/views/edit.py”, line 267, in save_models
self.new_obj.save()
File “/usr/local/lib/python3.6/dist-packages/django/db/models/base.py”, line 808, in save
force_update=force_update, update_fields=update_fields)
File “/usr/local/lib/python3.6/dist-packages/django/db/models/base.py”, line 838, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File “/usr/local/lib/python3.6/dist-packages/django/db/models/base.py”, line 924, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File “/usr/local/lib/python3.6/dist-packages/django/db/models/base.py”, line 963, in _do_insert
using=using, raw=raw)
File “/usr/local/lib/python3.6/dist-packages/django/db/models/manager.py”, line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/django/db/models/query.py”, line 1076, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File “/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py”, line 1111, in execute_sql
for sql, params in self.as_sql():
File “/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py”, line 1064, in as_sql
for obj in self.query.objs
File “/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py”, line 1064, in
for obj in self.query.objs
File “/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py”, line 1063, in
[self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
File “/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py”, line 1013, in pre_save_val
return field.pre_save(obj, add=True)
File “/usr/local/lib/python3.6/dist-packages/django/db/models/fields/files.py”, line 296, in pre_save
file.save(file.name, file.file, save=False)
File “/usr/local/lib/python3.6/dist-packages/django/db/models/fields/files.py”, line 94, in save
self.name = self.storage.save(name, content, max_length=self.field.max_length)
File “/usr/local/lib/python3.6/dist-packages/django/core/files/storage.py”, line 53, in save
name = self.get_available_name(name, max_length=max_length)
File “/usr/local/lib/python3.6/dist-packages/django/core/files/storage.py”, line 77, in get_available_name
while self.exists(name) or (max_length and len(name) > max_length):
File “/usr/local/lib/python3.6/dist-packages/django/core/files/storage.py”, line 392, in exists
return os.path.exists(self.path(name))
File “/usr/local/lib/python3.6/dist-packages/django/core/files/storage.py”, line 405, in path
return safe_join(self.location, name)
File “/usr/local/lib/python3.6/dist-packages/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/usr/local/lib/python3.6/dist-packages/django/core/files/storage.py”, line 283, in location
return abspathu(self.base_location)
File “/usr/lib/python3.6/posixpath.py”, line 371, in abspath
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not list
1回答
-
bobby
2019-07-01
你还记得你是配置了什么之后出的错吗? 如果无法找到可以留下qq 我加你看看
022019-07-03
相似问题