How to get './manage.py syncdb' to create additional views or run custom SQL?

Is there a way to run some custom SQL statements after syncdb does this by creating tables for models? In particular, I would like to create several database views.

+6
django django-models django-syncdb
source share
2 answers

Note. As mentioned in the comments, this method is deprecated from Django 1.7.

Or just create a file called sql / <modelname>. sql: http://docs.djangoproject.com/en/dev/howto/initial-data/#providing-initial-sql-data

+4
source share

Yes, there are signals that can be caught after syncdb.

See control signals for documents.

Here's how the contrib.auth permission table is populated, as well as the contenttypes frame table.

+9
source share