prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Docker startup getting stuck on mysqladmin ping
  **Environment**:
  
    - CTFd Version/Commit: ctfd/ctfd:latest from Docker hub (17 days old)
    - Operating System: Amazon Linux AMI 2017.09.j x86_64 ECS HVM GP2
    - Web Browser and Version: N/A
  
  **What happened?**
  
  Trying to setup CTFd with AWS ECS and RDS Aurora.
  If I don't set the DATABASE_URL env variable, it works fine and starts.
  If I do set the DATABASE_URL to mysql+pymysql://ctfd:<MYPASSWORD>@ctfd.<resource-id>i.eu-west-1.rds.amazonaws.com/ctfd I get stuck on docker-entrypoint.sh:7 `while ! mysqladmin ping -h db --silent; do`
  
  **What did you expect to happen?**
  
  That the ping should succeed and startup continue
  
  **How to reproduce your issue**
  
  Create an ECS task with ctfd/ctfd as image source, set env variable SECRET_KEY and DATABASE_URL. Start container.
  
  I have made sure the container can access the database by running `docker exec container-id mysql -h ctfd.<resource-id>.eu-west-1.rds.amazonaws.com -p<SECRET PASSWORD>` which works.
  
  **Any associated stack traces or error logs**
  
  Just stuck on "Waiting on MySQL"
  
  
  My question is basically: am I doing something wrong and should somehow make that "db" resolve to the database or is the script incorrect and should take the value of DATABASE_URL into account?
  
  </issue>
  <code>
  [start of wsgi.py]
  1 from CTFd import create_app
  2 
  3 app = create_app()
  4
  [end of wsgi.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/wsgi.py b/wsgi.py
  deleted file mode 100644
  --- a/wsgi.py
  +++ /dev/null
  @@ -1,3 +0,0 @@
  -from CTFd import create_app
  -
  -app = create_app()
  
verification_info: {"golden_diff": "diff --git a/wsgi.py b/wsgi.py\ndeleted file mode 100644\n--- a/wsgi.py\n+++ /dev/null\n@@ -1,3 +0,0 @@\n-from CTFd import create_app\n-\n-app = create_app()\n", "issue": "Docker startup getting stuck on mysqladmin ping\n**Environment**:\r\n\r\n  - CTFd Version/Commit: ctfd/ctfd:latest from Docker hub (17 days old)\r\n  - Operating System: Amazon Linux AMI 2017.09.j x86_64 ECS HVM GP2\r\n  - Web Browser and Version: N/A\r\n\r\n**What happened?**\r\n\r\nTrying to setup CTFd with AWS ECS and RDS Aurora.\r\nIf I don't set the DATABASE_URL env variable, it works fine and starts.\r\nIf I do set the DATABASE_URL to mysql+pymysql://ctfd:<MYPASSWORD>@ctfd.<resource-id>i.eu-west-1.rds.amazonaws.com/ctfd I get stuck on docker-entrypoint.sh:7 `while ! mysqladmin ping -h db --silent; do`\r\n\r\n**What did you expect to happen?**\r\n\r\nThat the ping should succeed and startup continue\r\n\r\n**How to reproduce your issue**\r\n\r\nCreate an ECS task with ctfd/ctfd as image source, set env variable SECRET_KEY and DATABASE_URL. Start container.\r\n\r\nI have made sure the container can access the database by running `docker exec container-id mysql -h ctfd.<resource-id>.eu-west-1.rds.amazonaws.com -p<SECRET PASSWORD>` which works.\r\n\r\n**Any associated stack traces or error logs**\r\n\r\nJust stuck on \"Waiting on MySQL\"\r\n\r\n\r\nMy question is basically: am I doing something wrong and should somehow make that \"db\" resolve to the database or is the script incorrect and should take the value of DATABASE_URL into account?\n", "before_files": [{"content": "from CTFd import create_app\n\napp = create_app()\n", "path": "wsgi.py"}]}