I know this question is old, but I am sending this method to those who find this question in the search results and need a good solution for later versions of Django (i.e. Django> = 1.8):
Create the data transfer as described here . This decision will be executed when the application is ported (and, possibly, as part of a deployment strategy) and allows you to write code that meets the specific needs of your database.
I consider this the cleanest method for setting the initial value for fields with the automatic nature of the database in Django> = 1.7, since it uses standard Django migrations and does not capture other structure functions in ways that may not work in the future.
source share