Why is urls.py treated as a .txt file and not as a .py? I tried to remove and re-create the file and even reinstall the program but it doesn't work.
2 Answers
I found these steps:
- (from OSX): PyCharm → Preferences → IDE Settings → File Types
- Select the affected File Type from the list on the top half of this dialog box, Recognized File Types (in my case, Text Files)
- Listed in the second half of the dialog box, Registered Patterns were the names of the files that I was having naming/syntax issues with. I clicked on each of those and then clicked on the - for each in turn to remove them from the Registered Patterns list.
- Click Apply
- Sigh of relief when the syntax highlighting returns and the icon changes back to that of a python file.