简体   繁体   English

views.py 文件无法识别为 Pycharm 中的 Python 文件

[英]views.py files not recognised as Python files in Pycharm

I am encountering problems while coding Django using Pycharm...我在使用 Pycharm 编码 Django 时遇到问题...

As you could see from the picture, for unknown reasons my Python file were recognised as text files... Even if there are coloring, the auto-fill for my code is definitely different from writting in other Python files.正如您从图片中看到的,由于未知原因,我的 Python 文件被识别为文本文件......即使有着色,我的代码的自动填充肯定与写入其他 Python 文件不同。

Here is the screenshot:这是屏幕截图:
截屏

Pretty much appreciate it!非常感谢!

Resetting config is too radical.重置配置太激进了。 views.py was associated with a wrong file type (text?) in Settings | views.py设置 |中的错误文件类型(文本?)相关联Editor |编辑 | File Types文件类型

在此处输入图像描述

I had the same problem, mine was listed in Settings |我有同样的问题,我的列在设置 | Editor |编辑 | File Types |文件类型 | Auto-detect file type by content .按内容自动检测文件类型 Once I removed it from there, pycharm was once again working like a charm.一旦我从那里删除它,pycharm 再次像魅力一样工作。

1. Method:一、方法:
Refresh Pycharm or Quit and open Pycharm again (restart Pycharm)刷新 Pycharm 或退出并再次打开 Pycharm(重启 Pycharm)
2. Method: 2.方法:
Wait for a minute, if there are a loading bar in bottom of Pycharm window稍等一下,如果 Pycharm window 底部有加载条
3. Method: 3.方法:
Reinstall Pycharm if both are not working如果两者都不起作用,请重新安装 Pycharm
Happy coding!快乐编码!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM