Please sign in to comment.
Automatically Call syncdb
To make sure that the database structure is properly created, we want to call ``manage.py syncdb`` automatically each time we push our code. On the first push, this will create the Django tables; later, it will create new tables that might be required by new models you will define. To make that happen, we create a ``postinstall`` script. It is called automatically at the end of each push operation. .. A few remarks: * this is a shell script (hence the ``#!/bin/sh`` shebang at the beginning), but you can also use a Python script if you like; * by default, ``syncdb`` will interactively prompt you to create a Django superuser in the database, but we cannot interact with the terminal during the push process, so we disable this thanks to ``--noinput``. If you push the code at this point, hitting the ``/admin`` URL will display the login form, but we don't have a valid user yet, and the login form won't have the usual Django CSS since we didn't take care about the static assets yet.
- Loading branch information...
|@@ -0,0 +1,2 @@|
|+python hellodjango/manage.py syncdb --noinput|