File handling in django

I have to edit models.py file. Add and remove fields through python file handling and “with” method. So, will it work in production environment?

Welcome @Mayankprajapati12 !

It can be made to work - keeping in mind that every change will require your application be stopped, run makemigrations and migrate, hope it all works correctly, and then restart the application.

Django is not designed around the concept of allowing for run-time alterations of Models.

See the thread at I'd like to enable the feature of dynamically changing `models.py` in my project. for more on this.