forked from lelerukjaymoh/django-startproject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatesuperuser
More file actions
executable file
·37 lines (22 loc) · 800 Bytes
/
createsuperuser
File metadata and controls
executable file
·37 lines (22 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
: '
Run The Script Inside Your Django Base Project Where You Got The manage.py File..
'
unset Username
unset Email
unset UserPassword
# Django Super User Creation Script
echo -e "\e[0;35m############################# \e[0m"
echo -e "\e[0;35m# Create Super User # \e[0m"
echo -e "\e[0;35m############################# \e[0m"
# username as a command line arguement
Username=$1
while [[ $Username = "" ]]; do
read -p 'Username can not be blank. Enter Username: ' Username
done
read -p "Email: " Email
read -sp 'Password: ' UserPassword
echo -e
# using create_superuser method
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('$Username', '$Email', '$UserPassword')" | python manage.py shell
echo -e