A server error occurred. Please contact the administrator.
来源:5-5 数据库函数
慕瓜1488005
2019-04-24
用老师的源码进行二次修改,在admin界面操作自定义内容后总是出现这个提示,请教老师大概是哪里出的问题?谢谢
2回答
-
咚咚呛
2019-04-24
这个应该是Django框架返回的错误,可以看看Django运行时产生了哪些错误日志呢?
122019-04-25 -
慕瓜1488005
提问者
2019-04-25
2019-04-25 17:23:05,323 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT "django_session"."session_key"
, "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."expire_date" > '2019-04-25 17:23:05.322202' AND "django_session"."ses
sion_key" = 'enwrh4wg5vwdcpz0isbxdovyn2k2l8bb'); args=('2019-04-25 17:23:05.322202', 'enwrh4wg5vwdcpz0isbxdovyn2k2l8bb')
2019-04-25 17:23:05,325 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT "authorization_user"."id", "au
thorization_user"."password", "authorization_user"."last_login", "authorization_user"."is_superuser", "authorization_user"."username", "authorization_user"."first_name", "authorizati
on_user"."last_name", "authorization_user"."email", "authorization_user"."is_staff", "authorization_user"."is_active", "authorization_user"."date_joined", "authorization_user"."open_
id", "authorization_user"."Userjobnumber", "authorization_user"."newTraining", "authorization_user"."nickname", "authorization_user"."focus_cities", "authorization_user"."focus_const
ellations", "authorization_user"."focus_stocks" FROM "authorization_user" WHERE "authorization_user"."id" = 1; args=(1,)
2019-04-25 17:23:05,325 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) BEGIN; args=None
2019-04-25 17:23:05,356 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.001) SELECT "drf_productionparts"."id", "d
rf_productionparts"."name", "drf_productionparts"."desc", "drf_productionparts"."number", "drf_productionparts"."parent_category_id", "drf_productionparts"."ProductionPartsLocation_i
d", "drf_productionparts"."date" FROM "drf_productionparts"; args=()
2019-04-25 17:23:05,361 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT "drf_storehouse"."id", "drf_st
orehouse"."name", "drf_storehouse"."desc", "drf_storehouse"."parent_category_id" FROM "drf_storehouse"; args=()
2019-04-25 17:23:05,367 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT "authorization_user"."id", "au
thorization_user"."password", "authorization_user"."last_login", "authorization_user"."is_superuser", "authorization_user"."username", "authorization_user"."first_name", "authorizati
on_user"."last_name", "authorization_user"."email", "authorization_user"."is_staff", "authorization_user"."is_active", "authorization_user"."date_joined", "authorization_user"."open_
id", "authorization_user"."Userjobnumber", "authorization_user"."newTraining", "authorization_user"."nickname", "authorization_user"."focus_cities", "authorization_user"."focus_const
ellations", "authorization_user"."focus_stocks" FROM "authorization_user"; args=()
2019-04-25 17:23:05,380 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\core\servers\basehttp.py:log_message:154] [INFO]- "GET /admin/drf/viewtable/add/ HTTP/1.
1" 200 10092
2019-04-25 17:23:07,091 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT "django_session"."session_key"
, "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."expire_date" > '2019-04-25 17:23:07.090902' AND "django_session"."ses
sion_key" = 'enwrh4wg5vwdcpz0isbxdovyn2k2l8bb'); args=('2019-04-25 17:23:07.090902', 'enwrh4wg5vwdcpz0isbxdovyn2k2l8bb')
2019-04-25 17:23:07,093 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT "authorization_user"."id", "au
thorization_user"."password", "authorization_user"."last_login", "authorization_user"."is_superuser", "authorization_user"."username", "authorization_user"."first_name", "authorizati
on_user"."last_name", "authorization_user"."email", "authorization_user"."is_staff", "authorization_user"."is_active", "authorization_user"."date_joined", "authorization_user"."open_
id", "authorization_user"."Userjobnumber", "authorization_user"."newTraining", "authorization_user"."nickname", "authorization_user"."focus_cities", "authorization_user"."focus_const
ellations", "authorization_user"."focus_stocks" FROM "authorization_user" WHERE "authorization_user"."id" = 1; args=(1,)
2019-04-25 17:23:07,094 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) BEGIN; args=None
2019-04-25 17:23:07,098 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.001) SELECT "drf_productionparts"."id", "d
rf_productionparts"."name", "drf_productionparts"."desc", "drf_productionparts"."number", "drf_productionparts"."parent_category_id", "drf_productionparts"."ProductionPartsLocation_i
d", "drf_productionparts"."date" FROM "drf_productionparts" WHERE "drf_productionparts"."id" = 1; args=(1,)
2019-04-25 17:23:07,100 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.001) SELECT "drf_storehouse"."id", "drf_st
orehouse"."name", "drf_storehouse"."desc", "drf_storehouse"."parent_category_id" FROM "drf_storehouse" WHERE "drf_storehouse"."id" = 1; args=(1,)
2019-04-25 17:23:07,101 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.001) SELECT "authorization_user"."id", "au
thorization_user"."password", "authorization_user"."last_login", "authorization_user"."is_superuser", "authorization_user"."username", "authorization_user"."first_name", "authorizati
on_user"."last_name", "authorization_user"."email", "authorization_user"."is_staff", "authorization_user"."is_active", "authorization_user"."date_joined", "authorization_user"."open_
id", "authorization_user"."Userjobnumber", "authorization_user"."newTraining", "authorization_user"."nickname", "authorization_user"."focus_cities", "authorization_user"."focus_const
ellations", "authorization_user"."focus_stocks" FROM "authorization_user" WHERE "authorization_user"."id" = 2; args=(2,)
2019-04-25 17:23:07,103 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT (1) AS "a" FROM "drf_productio
nparts" WHERE "drf_productionparts"."id" = 1 LIMIT 1; args=(1,)
2019-04-25 17:23:07,103 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT (1) AS "a" FROM "drf_storehous
e" WHERE "drf_storehouse"."id" = 1 LIMIT 1; args=(1,)
2019-04-25 17:23:07,104 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.000) SELECT (1) AS "a" FROM "authorization
_user" WHERE "authorization_user"."id" = 2 LIMIT 1; args=(2,)
2019-04-25 17:23:07,107 [Thread-2:17000] [D:\My project\MY_DRF2\venv\lib\site-packages\django\db\backends\utils.py:execute:110] [DEBUG]- (0.002) INSERT INTO "drf_viewtable" ("date",
"InputAndOutput", "number", "code_id", "StoreHouse_id", "user_id", "Enter", "Stock") VALUES ('2019-04-25 17:23:00', 1, 1, 1, 1, 2, '3', '2'); args=['2019-04-25 17:23:00', True, 1, 1,
1, 2, '3', '2']
Traceback (most recent call last):
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\contrib\admin\options.py", line 606, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\utils\decorators.py", line 142, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\views\decorators\cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\contrib\admin\sites.py", line 223, in inner
return view(request, *args, **kwargs)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\contrib\admin\options.py", line 1634, in add_view
return self.changeform_view(request, None, form_url, extra_context)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\utils\decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\utils\decorators.py", line 142, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\contrib\admin\options.py", line 1522, in changeform_view
return self._changeform_view(request, object_id, form_url, extra_context)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\contrib\admin\options.py", line 1565, in _changeform_view
self.log_addition(request, new_object, change_message)
File "D:\My project\MY_DRF2\venv\lib\site-packages\django\contrib\admin\options.py", line 810, in log_addition
object_repr=str(object),
TypeError: __str__ returned non-string (type int)
During handling of the above exception, another exception occurred:
00
相似问题