at deployment to server:
Run Migrations
With your model changes in place, create and apply the database migrations:
$ python manage.py makemigrations
$ python manage.py migrate
Existing Projects
For existing projects, you can call the populate command to generate an initial change for preexisting model instances:
$ python manage.py populate_history --auto
By default, history rows are inserted in batches of 200. This can be changed if needed for large tables by using the --batchsize option, for example --batchsize 500.
see https://github.com/jazzband/django-simple-history
at deployment to server: Run Migrations With your model changes in place, create and apply the database migrations:
$ python manage.py makemigrations $ python manage.py migrate Existing Projects For existing projects, you can call the populate command to generate an initial change for preexisting model instances:
$ python manage.py populate_history --auto By default, history rows are inserted in batches of 200. This can be changed if needed for large tables by using the --batchsize option, for example --batchsize 500.