django syncdb script - filesystem location + altering the script?
Question: i'm using django for a few projects already and now i'm facing a problem with
the syncdb command. I need to alter the functionality of that command, have
you got any experience with that?

`python manage.py` looks like this:

    
    
    #!/usr/bin/env python
    import os
    import sys
    
    if __name__ == "__main__":
        os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
    
        from django.core.management import execute_from_command_line
        execute_from_command_line(sys.argv)
    

I haven't found any `execute_from_command_line` on file system (to be more
precise, in the location `/usr/lib/python2.7/site-
packages/django/core/management`).

Any ideas, where is executed script located?

2) question:

Have you got any experience with manual altering of django database
(PostgreSQL) after `syncdb` is run and not running `syncdb` again to keep the
changes?

I need to change django constraints

`ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED` to

`ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED`

but if i do it manually, it is overwritten after syncdb is called again.


Answer: Thanks gertvdijk for the right direction. The solution is to use Custom SQL
queries, which are run just after creating the tables.

Django documentation can be found over here:
<https://docs.djangoproject.com/en/dev/howto/initial-data/#initial-sql>

