amazon web services - What is my user and pass? Deploy django on AWS EC2 but can not login admin -
i've followed youtube instruction amazon deploy django web app aws eb ec2. website ran. can not login admin. admin came django polls example. recall during setup process, prompt me rds setup , since web app use mysql, had pick rds setup. when setup rds, did not prompt me create user, prompted me create password, dutifully did.
https://www.youtube.com/watch?v=yjoonkisyws
similar instructions can found on aws, too.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_python_django.html
i've tried username 'root' , password 'blank' works on local pc, of course make things simple.
after attempt failed, did searching in ec2 , rds dashboard on aws, , found username=ebroot.
so tried username 'ebroot' , password [rds_password_from_setup], didn't work.
i've tried many other combinations of usernames , passwords nothing works. might stupid question ask online community, suppose username , password rds might accept?
in order create admin user django app on beanstalk created custom django command invoke in containers_commands, there no need human input @ all! defined user/password environment variables can put code under version control safely. implementation of command similar this:
import os django.core.management.base import basecommand com.cygora.apps.users.models.user import user class command(basecommand): def handle(self, *args, **options): username = os.environ['super_user_name'] if not user.objects.filter(username=username).exists(): user.objects.create_superuser(username, os.environ['super_user_email'], os.environ['super_user_password'])
then in beanstalk config:
container_commands: 02_create_superuser_for_django_admin: command: "python manage.py create_cygora_superuser" leader_only: true
ps: if never created custom django commands before, have to create package: management.commands
in desired app (ie: /your_project/your_app/management/commands/the_command.py), django load automatically (and can see when typing python manage.py --help
)
Comments
Post a Comment