I have a several classes in models.py, and I would like to load some data
into these models (or tables in the db), as well as add more data over time
through the admin panel.

I googled for some ideas on how to pre-populate the db tables, and found
references to RunSQL  (
https://docs.djangoproject.com/en/1.11/ref/migration-operations/#django.db.migrations.operations.RunSQL)
to execute some SQL commands during a migration (
http://blog.endpoint.com/2016/09/executing-custom-sql-in-django-migration.html
).

Is this the "correct" way to accomplish my goal of populating the data
tables with some data, or is there another way the more closely ties the
data to the models?

Thanks!

Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEqej2NDE8gqBEoSym1gA5DLD7Ygjo6MbN66mdwWDQ_Xd0%3DudA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to