Forums

FLASK_APP.PY | You do not have the permissions to edit

I have a Flask app, everything worked and right the time the website is working also.

But: the flask_app.py can not be edited. edit_denied

Do you know what sould I do?

Thank you in advance!

It looks like that file was edited on Windows and has a windows endline. That fooled our file type recognition and it was unable to guess that it is a python file so it has not enabled it for edit. You can still open that file in the editor in the console (eg. nano).

You can also run (in the bash console, in that directory)

sed -i 's/\r//' flask_app.py

and clean that file.

Also, if you use git and remote repository to move your code between your local Windows machine and PythonAnywhere, git will do the endline stuff for you.

@fjl

Appreciation post:

It works, thank you very much! :D