prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Nightly support
  - nightlies don't have a separate version number but a flag:
  
  ```
  curl -X POST -u "user:password" http://localhost:8000/api/v1/apps/releases -H "Content-Type: application/json" -d '{"download":"https://example.com/release.tar.gz", "nightly":true }'
  ```
  - this is also listed in the "get all apps" API with a `nightly: true` attribute https://nextcloudappstore.readthedocs.io/en/latest/restapi.html#get-all-apps-and-releases
  - upload of a new nightly will delete the previous one for that app
  - this allows to upgrade to a nightly (needs to be invoked by the admin and can be undone -> next regular release of the app will be installed)
  
  
  </issue>
  <code>
  [start of nextcloudappstore/core/api/v1/urls.py]
  1 from django.conf.urls import url
  2 from django.views.decorators.http import etag
  3 from nextcloudappstore.core.api.v1.views import Apps, AppReleases, \
  4     app_api_etag, Categories, category_api_etag
  5 
  6 urlpatterns = [
  7     url(r'^platform/(?P<version>\d+\.\d+\.\d+)/apps\.json$',
  8         etag(app_api_etag)(Apps.as_view()), name='apps'),
  9     url(r'^apps/releases/?$', AppReleases.as_view(),
  10         name='app-release-create'),
  11     url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),
  12     url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\d+\.\d+\.\d+)/?$',
  13         AppReleases.as_view(), name='app-release-delete'),
  14     url(r'^categories.json$',
  15         etag(category_api_etag)(Categories.as_view()), name='categories'),
  16 ]
  17
  [end of nextcloudappstore/core/api/v1/urls.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/nextcloudappstore/core/api/v1/urls.py b/nextcloudappstore/core/api/v1/urls.py
  --- a/nextcloudappstore/core/api/v1/urls.py
  +++ b/nextcloudappstore/core/api/v1/urls.py
  @@ -9,7 +9,8 @@
       url(r'^apps/releases/?$', AppReleases.as_view(),
           name='app-release-create'),
       url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),
  -    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\d+\.\d+\.\d+)/?$',
  +    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\d+\.\d+\.\d+'
  +        r'(?:-nightly)?)/?$',
           AppReleases.as_view(), name='app-release-delete'),
       url(r'^categories.json$',
           etag(category_api_etag)(Categories.as_view()), name='categories'),
  
verification_info: {"golden_diff": "diff --git a/nextcloudappstore/core/api/v1/urls.py b/nextcloudappstore/core/api/v1/urls.py\n--- a/nextcloudappstore/core/api/v1/urls.py\n+++ b/nextcloudappstore/core/api/v1/urls.py\n@@ -9,7 +9,8 @@\n     url(r'^apps/releases/?$', AppReleases.as_view(),\n         name='app-release-create'),\n     url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),\n-    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\\d+\\.\\d+\\.\\d+)/?$',\n+    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\\d+\\.\\d+\\.\\d+'\n+        r'(?:-nightly)?)/?$',\n         AppReleases.as_view(), name='app-release-delete'),\n     url(r'^categories.json$',\n         etag(category_api_etag)(Categories.as_view()), name='categories'),\n", "issue": "Nightly support\n- nightlies don't have a separate version number but a flag:\n\n```\ncurl -X POST -u \"user:password\" http://localhost:8000/api/v1/apps/releases -H \"Content-Type: application/json\" -d '{\"download\":\"https://example.com/release.tar.gz\", \"nightly\":true }'\n```\n- this is also listed in the \"get all apps\" API with a `nightly: true` attribute https://nextcloudappstore.readthedocs.io/en/latest/restapi.html#get-all-apps-and-releases\n- upload of a new nightly will delete the previous one for that app\n- this allows to upgrade to a nightly (needs to be invoked by the admin and can be undone -> next regular release of the app will be installed)\n\n", "before_files": [{"content": "from django.conf.urls import url\nfrom django.views.decorators.http import etag\nfrom nextcloudappstore.core.api.v1.views import Apps, AppReleases, \\\n    app_api_etag, Categories, category_api_etag\n\nurlpatterns = [\n    url(r'^platform/(?P<version>\\d+\\.\\d+\\.\\d+)/apps\\.json$',\n        etag(app_api_etag)(Apps.as_view()), name='apps'),\n    url(r'^apps/releases/?$', AppReleases.as_view(),\n        name='app-release-create'),\n    url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),\n    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\\d+\\.\\d+\\.\\d+)/?$',\n        AppReleases.as_view(), name='app-release-delete'),\n    url(r'^categories.json$',\n        etag(category_api_etag)(Categories.as_view()), name='categories'),\n]\n", "path": "nextcloudappstore/core/api/v1/urls.py"}]}