Django fabric syncdb

How would you run this django command to synchronize with the fabric automatically.

python manage.py syncdb --settings="app.settings.test" 

if he tried to run, he was stuck in "Do you want to create a superuser account", can it be transmitted as "yes" and the information for entering with him.

 run('python manage.py syncdb --settings="app.settings.%s"' % name, pty=True) 
+4
source share
1 answer

Add --noinput to the arguments to invoke the django-admin request:

 python manage.py syncdb --settings="app.settings.%s" --noinput 

If you have certain credentials that you would like to preload, I suspect that the easiest way to achieve this is to dump the user database data from a computer with a (simple!) Loaded administrator account and then download it after syncdb. Alternatively, you can simply leave the administrator account and add it later manage.py createsuperuser when and if you need to have it.

+8
source

Source: https://habr.com/ru/post/1302327/


All Articles