Skip to content

Commit

Permalink
update env
Browse files Browse the repository at this point in the history
  • Loading branch information
skoulouzis committed Sep 6, 2023
1 parent e751f67 commit 75d8dc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion vre-panel/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
API_BASE_PATH=/vre-api-test/api
API_BASE_PATH=/vre-api/api
FRONTEND_BASE_PATH=/vreapp
2 changes: 1 addition & 1 deletion vre-panel/pages/auth/signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function getServerSideProps(context: { req: any; }) {
redirect: { destination: '/' },
};
}
console.log("providers", providers)
console.log("providers: ", providers)
return {
props: { providers },
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
from django.core.management.base import BaseCommand
import os

class Command(BaseCommand):

class Command(BaseCommand):
help = "Creates an admin user non-interactively if it doesn't exist"

def add_arguments(self, parser):
parser.add_argument('--username', help="Admin's username")
parser.add_argument('--email', help="Admin's email")
parser.add_argument('--username', help="Admin's username")
parser.add_argument('--email', help="Admin's email")

def handle(self, *args, **options):

password = os.environ.get("DJANGO_SUPERUSER_PASSWORD", default="")
password = os.environ.get("DJANGO_SUPERUSER_PASSWORD", default="change_me_please")
self.stdout.write(f"Admin password from ENV {password}")
User = get_user_model()
if not User.objects.filter(username=options['username']).exists():
self.stdout.write(f"Admin user {options['username']} not present, creating it ...")
user= User.objects.create_superuser(username=options['username'], email=options['email'])
user = User.objects.create_superuser(username=options['username'], email=options['email'])
user.set_password(password)
user.save()
self.stdout.write(f"Admin user {options['username']} created!")

0 comments on commit 75d8dc3

Please sign in to comment.