Question : django admin create superuser
Answered by : defeated-dog-imtad4yyvbbw
$ python manage.py createsuperuser
Source : | Last Update : Thu, 04 Jun 20
Question : create superuser django shell
Answered by : clear-camel-6h15y86kbq40
user@host> manage.py shell
>>> from django.contrib.auth.models import User
>>> user=User.objects.create_user('foo', password='bar')
>>> user.is_superuser=True
>>> user.is_staff=True
>>> user.save()
Source : https://stackoverflow.com/a/18504852/5916941 | Last Update : Thu, 19 Aug 21
Question : django create superuser from script
Answered by : arno-deceuninck
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
class Command(BaseCommand): def handle(self, *args, **options): # The magic line User.objects.create_user(username= 'rmx', email='[email protected]', password='rmx55', is_staff=True, is_active=True, is_superuser=True )
Source : https://stackoverflow.com/questions/6244382/how-to-automate-createsuperuser-on-django | Last Update : Sat, 20 Mar 21
Question : How to create a superuser in django
Answered by : coding-gear
$ python manage.py createsuperuser
Username (leave blank to use 'computername'):
Email:
Password:
Password (again):
Superuser created successfully.
//the terminal will not show your password as you type for security reasons
Source : https://codinggear.blog/how-to-create-superuser-in-django/ | Last Update : Fri, 26 Aug 22
Question : aws django create superuser
Answered by : vipin-yadav
# go to https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html#python-django-update-app
# copy the code
container_commands: 01_migrate: command: "source /var/app/venv/*/bin/activate && python3 manage.py migrate" leader_only: true
option_settings: aws:elasticbeanstalk:application:environment: DJANGO_SETTINGS_MODULE: ebdjango.settings
# on terminal run
nano .ebextentions/db-migrate.config
# paste the above copied code and change DJANGO_SETTINGS_MODULE to
DJANGO_SETTINGS_MODULE: project-name.settings
# now create superusesr using following code
02_createsuperuser: command: "echo \"from django.contrib.auth.models import User; User.objects.create_superuser('vipin', '[email protected]', 'django1234')\" | python manage.py shell" leader_only: true
#save this file and run "eb deploy" on terminal
Source : | Last Update : Mon, 25 Jul 22