How i can add new fields into models when Django project in the production environment. | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 7

How i can add new fields into models when Django project in the production environment.

My Django website has been live on digital ocean server from last 4 months. I need to add a new field into my models. How I can add that. Should new fields be added when your project in a production environment? I'm using PostgreSQL database. Nginx web server and using gunicorn.

4th Nov 2020, 8:25 AM
Maninder $ingh
Maninder $ingh - avatar
1 ответ
+ 3
Maninder $ingh If you want to add the field in live production environment I would suggest trying with installing "South" and fake the migration with adding new field. You can test it once here are some links which is stating to do the desired thing with faking the migration. ▶ https://stackoverflow.com/questions/22275083/add-field-to-existing-django-app-in-production-environmenthttps://medium.com/swlh/production-ready-method-of-extending-django-user-model-in-mid-project-3afa174b000bhttps://stackoverflow.com/questions/22697202/django-1-5-how-do-i-add-a-new-model-field-to-an-existing-table-using-south-with/22697396
9th Nov 2020, 12:33 PM
Preity
Preity - avatar