Details
-
Type: Task
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Story Points:0.5
-
Epic Link:
-
Sprint:Spring 8 : 24 Apr to 8 May, Spring 8 : 11 May to 25 May
Description
We need to create a Django admin user for each new App Store.
When provisioning an App Store manually, we do this by running:
- manage.py createsuperuser [adminuser]
When we do this, manage.py asks you to enter a password manually.
Currently, there does not appear to be an option to pass in the password as a command line option.
However, when using manage.py from ansible (using the django_manage role), we cannot easily enter the password manually.
Others have discussed this problem, and a couple of solutions were proposed here:
For this task, design and develop a solution that will allow us to write and run a django_admin or other task that creates the superuser. Include a comment linking to the above StackOverflow post if you write a script or any other new code for this.
See also documentation for the django_admin role:
Describe the solution you think is best in the comments below. We'll implement it under a separate ticket.
Attachments
Issue Links
- blocks
-
IGBF-2365 Create superuser account using ansible
- Closed
Django module when creating super user assigns a random password. There is no direct way for creating super user
django_manage allows for custom commands.
Solution 1 :
1. Check if a superuser is already present
2. Use command attribute of the django_manage to invoke a shell execution for creating the superuser.
Solution 2(to be used only if the solution 1 fails):
using the shell module execute the super user creation