1

I am trying to create a superuser for my app in Django. It's easy in localhost. However, I can't figure out how to do it in Elastic Beanstalk.

The methods I've tried are aws guide and realpython . However, none seems to work. My database is posgresql and it's connected to my application. However no superuser is being created through migrations.

How is it supposed to work?

QuestionEverything
  • 4,809
  • 7
  • 42
  • 61
  • What do you mean, "created through migrations"? Neither of those tutorials propose creating a superuser via migrations. – Daniel Roseman May 16 '17 at 17:30
  • was the user i've created locally supposed to transfer to the beanstalk database automatically? i'm confused here. – QuestionEverything May 16 '17 at 17:33
  • No. The realpython tutorial suggests creating a specific management command to create the user (of course, you should immediately change the password via the admin site). – Daniel Roseman May 16 '17 at 17:39

1 Answers1

0

You can create a superuser using the regular 'python manage.py createsuperuser' command from one of the EC2 instances running your application, following the instructions at Run manage.py from AWS EB Linux instance

Notice that in order to be able to SSH into an instance, you need to provide a key-pair while creating your EB environment.

Alex Glikson
  • 401
  • 4
  • 13