简体   繁体   English

在Elastic Beanstalk Postgresql中创建Django超级用户

[英]Create Django Super User in Elastic Beanstalk Postgresql

I am trying to create a superuser for my app in Django. 我想在Django中为我的应用程序创建一个超级用户。 It's easy in localhost. 在localhost中很容易。 However, I can't figure out how to do it in Elastic Beanstalk. 但是,我无法弄清楚如何在Elastic Beanstalk中执行此操作。

The methods I've tried are aws guide and realpython . 我尝试过的方法是aws指南realpython However, none seems to work. 但是,似乎都没有效果。 My database is posgresql and it's connected to my application. 我的数据库是posgresql,它连接到我的应用程序。 However no superuser is being created through migrations. 但是,没有通过迁移创建超级用户。

How is it supposed to work? 它应该如何工作?

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 您可以使用来自运行应用程序的EC2实例之一的常规“python manage.py createsuperuser”命令创建超级用户,遵循AWS EB Linux实例中的运行manage.py中的说明

Notice that in order to be able to SSH into an instance, you need to provide a key-pair while creating your EB environment. 请注意,为了能够SSH到实例,您需要在创建EB环境时提供密钥对。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM