简体   繁体   中英

How to recover the views.py file in django?

I am using Django on Linux and am currently completing the tutorial, but a case of human error occurred. I accidentally deleted the views.py file (in tutorial is in the polls directory) and it would really help if anyone knew a way to reinstall the files, or if it is even necessary in the first place. I'm new to Django, so please keep that in mind. Thank you.

The views.py doesn't contain anything until you write it. If you hadn't written anything yet, then just create a new empty file and call it views.py.

In future, you should always use source control.

Hope this will help you https://github.com/wibiti/uncompyle2

See this answer on uncompyle2 for some other comments.

There is no way of getting back the files. They are deleted.

You could try a program that scans for deleted files, but don't count on it.

Source control and frequent backups are the best methods of preventing this problem in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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