prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [Proposal] Warn and/or fail if default admin's password hasn't been changed
  Feature description
  ---------
  Proposal: warn and/or fail if default `admin`'s password hasn't been changed.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `backend/api/management/commands/create_admin.py`
  Content:
  ```
  1 from django.contrib.auth.management.commands import createsuperuser
  2 from django.core.management import CommandError
  3 
  4 
  5 class Command(createsuperuser.Command):
  6     help = "Non-interactively create an admin user"
  7 
  8     def add_arguments(self, parser):
  9         super().add_arguments(parser)
  10         parser.add_argument("--password", default=None, help="The password for the admin.")
  11 
  12     def handle(self, *args, **options):
  13         password = options.get("password")
  14         username = options.get("username")
  15 
  16         if password and not username:
  17             raise CommandError("--username is required if specifying --password")
  18 
  19         try:
  20             super().handle(*args, **options)
  21         except Exception as err:
  22             if "is already taken" in str(err):
  23                 self.stderr.write(f"User {username} already exists.")
  24             else:
  25                 raise
  26 
  27         if password:
  28             database = options.get("database")
  29             db = self.UserModel._default_manager.db_manager(database)
  30             user = db.get(username=username)
  31             user.set_password(password)
  32             self.stderr.write(f"Setting password for User {username}.")
  33             user.save()
  34
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/backend/api/management/commands/create_admin.py b/backend/api/management/commands/create_admin.py
  --- a/backend/api/management/commands/create_admin.py
  +++ b/backend/api/management/commands/create_admin.py
  @@ -13,9 +13,17 @@
           password = options.get("password")
           username = options.get("username")
   
  -        if password and not username:
  +        if not username:
  +            self.stderr.write("Error: Blank username isn't allowed.")
               raise CommandError("--username is required if specifying --password")
   
  +        if not password:
  +            self.stderr.write("Error: Blank password isn't allowed.")
  +            raise CommandError("--password is required")
  +
  +        if password == "password":
  +            self.stdout.write(self.style.WARNING("Warning: You should change the default password."))
  +
           try:
               super().handle(*args, **options)
           except Exception as err:
  @@ -24,10 +32,10 @@
               else:
                   raise
   
  -        if password:
  -            database = options.get("database")
  -            db = self.UserModel._default_manager.db_manager(database)
  -            user = db.get(username=username)
  -            user.set_password(password)
  -            self.stderr.write(f"Setting password for User {username}.")
  -            user.save()
  +        database = options.get("database")
  +        db = self.UserModel._default_manager.db_manager(database)
  +        user = db.get(username=username)
  +        user.set_password(password)
  +        message = f"Setting password for User {username}."
  +        self.stdout.write(self.style.SUCCESS(message))
  +        user.save()
  
verification_info: {"golden_diff": "diff --git a/backend/api/management/commands/create_admin.py b/backend/api/management/commands/create_admin.py\n--- a/backend/api/management/commands/create_admin.py\n+++ b/backend/api/management/commands/create_admin.py\n@@ -13,9 +13,17 @@\n         password = options.get(\"password\")\n         username = options.get(\"username\")\n \n-        if password and not username:\n+        if not username:\n+            self.stderr.write(\"Error: Blank username isn't allowed.\")\n             raise CommandError(\"--username is required if specifying --password\")\n \n+        if not password:\n+            self.stderr.write(\"Error: Blank password isn't allowed.\")\n+            raise CommandError(\"--password is required\")\n+\n+        if password == \"password\":\n+            self.stdout.write(self.style.WARNING(\"Warning: You should change the default password.\"))\n+\n         try:\n             super().handle(*args, **options)\n         except Exception as err:\n@@ -24,10 +32,10 @@\n             else:\n                 raise\n \n-        if password:\n-            database = options.get(\"database\")\n-            db = self.UserModel._default_manager.db_manager(database)\n-            user = db.get(username=username)\n-            user.set_password(password)\n-            self.stderr.write(f\"Setting password for User {username}.\")\n-            user.save()\n+        database = options.get(\"database\")\n+        db = self.UserModel._default_manager.db_manager(database)\n+        user = db.get(username=username)\n+        user.set_password(password)\n+        message = f\"Setting password for User {username}.\"\n+        self.stdout.write(self.style.SUCCESS(message))\n+        user.save()\n", "issue": "[Proposal] Warn and/or fail if default admin's password hasn't been changed\nFeature description\r\n---------\r\nProposal: warn and/or fail if default `admin`'s password hasn't been changed.\n", "before_files": [{"content": "from django.contrib.auth.management.commands import createsuperuser\nfrom django.core.management import CommandError\n\n\nclass Command(createsuperuser.Command):\n    help = \"Non-interactively create an admin user\"\n\n    def add_arguments(self, parser):\n        super().add_arguments(parser)\n        parser.add_argument(\"--password\", default=None, help=\"The password for the admin.\")\n\n    def handle(self, *args, **options):\n        password = options.get(\"password\")\n        username = options.get(\"username\")\n\n        if password and not username:\n            raise CommandError(\"--username is required if specifying --password\")\n\n        try:\n            super().handle(*args, **options)\n        except Exception as err:\n            if \"is already taken\" in str(err):\n                self.stderr.write(f\"User {username} already exists.\")\n            else:\n                raise\n\n        if password:\n            database = options.get(\"database\")\n            db = self.UserModel._default_manager.db_manager(database)\n            user = db.get(username=username)\n            user.set_password(password)\n            self.stderr.write(f\"Setting password for User {username}.\")\n            user.save()\n", "path": "backend/api/management/commands/create_admin.py"}], "after_files": [{"content": "from django.contrib.auth.management.commands import createsuperuser\nfrom django.core.management import CommandError\n\n\nclass Command(createsuperuser.Command):\n    help = \"Non-interactively create an admin user\"\n\n    def add_arguments(self, parser):\n        super().add_arguments(parser)\n        parser.add_argument(\"--password\", default=None, help=\"The password for the admin.\")\n\n    def handle(self, *args, **options):\n        password = options.get(\"password\")\n        username = options.get(\"username\")\n\n        if not username:\n            self.stderr.write(\"Error: Blank username isn't allowed.\")\n            raise CommandError(\"--username is required if specifying --password\")\n\n        if not password:\n            self.stderr.write(\"Error: Blank password isn't allowed.\")\n            raise CommandError(\"--password is required\")\n\n        if password == \"password\":\n            self.stdout.write(self.style.WARNING(\"Warning: You should change the default password.\"))\n\n        try:\n            super().handle(*args, **options)\n        except Exception as err:\n            if \"is already taken\" in str(err):\n                self.stderr.write(f\"User {username} already exists.\")\n            else:\n                raise\n\n        database = options.get(\"database\")\n        db = self.UserModel._default_manager.db_manager(database)\n        user = db.get(username=username)\n        user.set_password(password)\n        message = f\"Setting password for User {username}.\"\n        self.stdout.write(self.style.SUCCESS(message))\n        user.save()\n", "path": "backend/api/management/commands/create_admin.py"}]}