易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 35|回复: 0
收起左侧

django python 报错warnings.warn("DateTimeField %s received a naive datetime (

[复制链接]
发表于 2025-7-25 23:09:10 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
C:\Users\admin\python3.8.2-vitual\lib\site-packages\django\db\models\fields\__init__.py:1365: RuntimeWarning: DateTimeField Order.created_at received a naive datetime (2025-07-25 00:00:00) while time zone support is active.
9 k4 D$ R; G( S7 K  warnings.warn("DateTimeField %s received a naive datetime (%s)"; a. E. j3 _8 p4 B
C:\Users\admin\python3.8.2-vitual\lib\site-packages\django\db\models\fields\__init__.py:1365: RuntimeWarning: DateTimeField Profile.created_at received a naive datetime (2025-07-25 00:00:00) while time zone support is active.
" Y+ r7 o7 Y; a! s+ X0 f6 }4 l; c  warnings.warn("DateTimeField %s received a naive datetime (%s)"" E9 F) q6 {6 X" ?+ v, r5 I
C:\Users\admin\python3.8.2-vitual\lib\site-packages\django\db\models\fields\__init__.py:1365: RuntimeWarning: DateTimeField Order.created_at received a naive datetime (2025-07-24 00:00:00) while time zone support is active.
  G  U. R" [+ `+ |' N1 }/ G% @3 i8 H* o  warnings.warn("DateTimeField %s received a naive datetime (%s)"+ I* y- |9 F7 z& o/ h
C:\Users\admin\python3.8.2-vitual\lib\site-packages\django\db\models\fields\__init__.py:1365: RuntimeWarning: DateTimeField Profile.created_at received a naive datetime (2025-07-24 00:00:00) while time zone support is active.  D+ Y, `% q5 R
  warnings.warn("DateTimeField %s received a naive datetime (%s)"
8 A2 Q0 x. O" t[25/Jul/2025 23:03:09] "GET /master/ HTTP/1.1" 200 10084
! C8 Z. S7 ~" G. w2 H  dC:\Users\admin\Desktop\deskdirectory\trip\trip\settings.py changed, reloading.( w0 l5 Q! ^2 h/ D- j! ~" X
% H. k7 `0 g0 m7 W5 {" B

5 P0 h, \! O7 U  |报错:
+ u/ \. F- ^+ H9 V" Q8 f* q找到settings.py文件:( p& ~6 t, s3 }. ~7 V) a5 e

' R- d, V8 T! O9 J找到
/ E1 P  E& v) M; ]USE_TZ = True0 L' g' H: B$ K, w& d" n8 g

2 b% K! ^/ a: b4 z( \" T! F改成:4 x* _- o/ Q8 g1 a) P  c" |" [0 t0 p
5 E" O. J; x+ c# S; U+ u7 X
3 O, C8 |; ?+ [6 z6 h
USE_TZ = False
$ y5 k- v) B  ~# z7 T$ E1 J# j3 m" u; E* C+ s* }2 j5 t/ W

3 P1 c" g4 Z) ]0 X保存重启,问题不在出现:+ D5 N; `# ^' _5 ^

- W' `) D$ n& s  e. E- a6 F5 p& ]' xWatching for file changes with StatReloader3 |0 I  G, n, u, K" k( W5 y/ F7 m
System check identified no issues (0 silenced)." T9 U# Z6 H: ]$ T: G) p
July 25, 2025 - 23:06:14! H0 D+ i' e) R
Django version 3.0.5, using settings 'trip.settings'
. E; y% y; p. e  E. N$ v- B8 p7 kStarting development server at http://0.0.0.0:8000/6 x! Y1 B) \2 |8 @: M& K2 W( d
Quit the server with CTRL-BREAK.
. q9 ^+ X4 F7 B! l* |2 n8 W7 i7 M; R[25/Jul/2025 23:06:19] "GET /master/ HTTP/1.1" 200 10094; n% `4 I! V+ R: o5 G, W
' t) T' q: C' g3 C4 P4 v6 N% {

3 n4 k. d" b+ F- x$ E# x4 q) p% r' l9 G$ f/ v2 I2 [
问题解决。: Y1 a. k" [! S* _7 |
6 D4 \$ T. U/ I
/ k, v- j2 G6 z% _
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 21:31 , Processed in 0.040680 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表