djangodjango-modelsdjango-syncdb

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 it thing creating the tables for the models? Specifically, I would like to create some database views.


Solution

  • Note: As mentioned in the comments, this method is deprecated as of 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