2
最近,我正在與docker部署一個應用程序。我遇到了一個關於如何編寫將在Linux上執行的啓動腳本的問題。一個例子是老鄉:如何使用Linux shell腳本在Django中創建超級用戶?
通常情況下,我們建立這樣的超級用戶:
iMac:mysite yetongxue$ python manage.py createsuperuser
Username (leave blank to use 'yetongxue'): root
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.
但是當搬運工部署應用程序,我必須在腳本將泊塢窗容器開始後執行寫這個命令。如何在腳本中設置用戶名,電子郵件和密碼?謝謝!
#!/bin/bash
python manage.py createsuperuser
是,這是一個有益的方法。謝謝。 –